当前位置: 首页>>代码示例>>PHP>>正文


PHP Mail::pretend方法代码示例

本文整理汇总了PHP中Mail::pretend方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::pretend方法的具体用法?PHP Mail::pretend怎么用?PHP Mail::pretend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mail的用法示例。


在下文中一共展示了Mail::pretend方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * Perform test case set up
  *
  * @deprecated use pluginTestSetUp method
  */
 public final function setUp()
 {
     /*
      * Create application instance
      */
     parent::setUp();
     /*
      * Reboot October Singletons' dependencies
      */
     \System\Classes\PluginManager::instance()->bindContainerObjects();
     \System\Classes\UpdateManager::instance()->bindContainerObjects();
     /*
      * If test maker wants to create functional test, migrate october and given plugins
      */
     if (count($this->refreshPlugins) > 0) {
         foreach ($this->refreshPlugins as $pluginCode) {
             $this->refreshPlugin($pluginCode);
         }
     }
     /*
      * If test maker wants october environment for some reason, migrate october
      */
     if (count($this->refreshPlugins) === 0 && $this->requiresOctoberMigration) {
         $this->migrateOctober();
     }
     /*
      * Prevent mailer from actually sending emails
      */
     Mail::pretend(true);
     $this->pluginTestSetUp();
 }
开发者ID:janusnic,项目名称:oc-plugin-testsuite,代码行数:36,代码来源:OctoberPluginTestCase.php

示例2: setUp

 /**
  * Préparation avant les tests
  */
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     $this->seed();
     Mail::pretend(true);
 }
开发者ID:Anassdev,项目名称:Laravel-Echyzen,代码行数:10,代码来源:TestCase.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     \Mail::pretend(true);
     $this->to = ['address' => 'foo@bar.com', 'name' => 'foobar'];
     \Config::set('mailform.delivery_to', $this->to);
 }
开发者ID:larasite,项目名称:larasite,代码行数:7,代码来源:SendMailFomrTest.php

示例4: setUp

 /**
  * Perform test case set up.
  * @return void
  */
 public function setUp()
 {
     /*
      * Create application instance
      */
     parent::setUp();
     /*
      * Rebind Laravel container in October Singletons
      */
     UpdateManager::instance()->bindContainerObjects();
     PluginManager::instance()->bindContainerObjects();
     /*
      * Ensure system is up to date
      */
     $this->runOctoberUpCommand();
     /*
      * Detect plugin from test and autoload it
      */
     $this->pluginTestCaseLoadedPlugins = [];
     $pluginCode = $this->guessPluginCodeFromTest();
     if ($pluginCode !== false) {
         $this->runPluginRefreshCommand($pluginCode, false);
     }
     /*
      * Disable mailer
      */
     Mail::pretend();
 }
开发者ID:nerijunior,项目名称:october,代码行数:32,代码来源:PluginTestCase.php

示例5: prepareForTests

 /**
  * Prepare for the tests to be run.
  */
 public function prepareForTests()
 {
     // Enable your route filters, very important!
     \Route::enableFilters();
     \Route::any('{all}', 'Tdt\\Core\\BaseController@handleRequest')->where('all', '.*');
     \Mail::pretend(true);
 }
开发者ID:jalbertbowden,项目名称:core,代码行数:10,代码来源:TestCase.php

示例6: prepareForTests

 public function prepareForTests()
 {
     Artisan::call('migrate');
     /* This method will prepare the database, and change the status of Laravel's Mailer class to pretend. 
      * This way, the Mailer will not send any real email when running tests. Instead, it will log 
      * the "sent" messages.  */
     Mail::pretend(true);
 }
开发者ID:resmall,项目名称:simple-admin-panel,代码行数:8,代码来源:TestCase.php

示例7: prepareForTests

 /**
  * Migrates the database and set the mailer to 'pretend'.
  * This will cause the tests to run quickly.
  */
 private function prepareForTests()
 {
     if (!\File::exists(base_path() . '/config/testing')) {
         \File::copyDirectory(__DIR__ . '/../config/testing/', base_path() . '/config/testing');
     }
     Artisan::call('migrate');
     Mail::pretend(true);
 }
开发者ID:claremontdesign,项目名称:naradmin,代码行数:12,代码来源:IndexTest.php

示例8: setUp

 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed');
     Mail::pretend(true);
     Route::enableFilters();
     App::bind('Helpers\\JsonRPCClientInterface', 'Helpers\\DummyJsonRPCClient');
     App::bind('Helpers\\DataParserInterface', 'Helpers\\DummyDataParser');
 }
开发者ID:denpamusic,项目名称:EzBitcoin-Api-Wallet,代码行数:10,代码来源:TestCase.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     //$this->app['router']->enableFilters();
     ini_set('memory_limit', '256M');
     // Temporarily increase memory limit to 256MB
     $artisan = $this->app->make('artisan');
     $artisan->call('migrate', ['--database' => 'testbench', '--path' => '../src/migrations']);
     $artisan->call('migrate', ['--database' => 'testbench', '--package' => 'Cartalyst/Sentry', '--path' => '../vendor/cartalyst/sentry/src/migrations']);
     Mail::pretend(true);
 }
开发者ID:tusharvikky,项目名称:redminportal,代码行数:11,代码来源:RedminTestCase.php

示例10: setUp

 /**
  * Default preparation for each test
  */
 public function setUp()
 {
     parent::setUp();
     // Migrate database
     Artisan::call('migrate');
     // Do not send mails
     Mail::pretend(true);
     // To create test models
     Model::unguard();
     // Logout - just to be sure
     \Sentry::logout();
 }
开发者ID:rafaelvieiras,项目名称:connect,代码行数:15,代码来源:TestCase.php

示例11: send_email

 private function send_email($user)
 {
     if (Request::server('SERVER_NAME') != 'localhost') {
         Mail::send('emails.auth.authenticate', array('email' => $user->email, 'url' => URL::to('activate') . '/' . $user->activation_token), function ($message) use($user) {
             $message->to($user->email, 'User')->subject('Please Validate your account - Dispatch Taxi Cab. ');
         });
     } else {
         Mail::pretend('emails.auth.authenticate', array('email' => $user->email, 'url' => URL::to('activate') . '/' . $user->activation_token), function ($message) use($user) {
             $message->to($user->email, 'User')->subject('Please Validate your account - Dispatch Taxi Cab. ');
         });
     }
 }
开发者ID:prateekchandan,项目名称:dipatchtaxicab-server,代码行数:12,代码来源:UserController.php

示例12: prepareForTests

 /**
  * Migrate the database
  */
 private function prepareForTests()
 {
     /*DB::unprepared(file_get_contents('/home/james/projects/vdragon/vdragon-api/scripts/db/mysql-to-sqlite/sqlite.dump.sql'));
     		$sql = file_get_contents(base_path().'/scripts/db/populate_country.sql');
     		DB::statement($sql);
                     $sql = file_get_contents(base_path().'/scripts/db/populate_territory.sql');
     		DB::statement($sql);
     	        DB::statement('update territories set country_id=(select id from countries where name=\'Sweden\')');
                     */
     Artisan::call('migrate:refresh');
     Artisan::call('db:seed');
     Mail::pretend(true);
 }
开发者ID:rhalff,项目名称:vdragon-api,代码行数:16,代码来源:TestCase.php

示例13: setUp

 /**
  * Sets up environment for each test.
  * Temporariliy increase memory limit, run migrations and set Mail::pretend to true.
  */
 public function setUp()
 {
     parent::setUp();
     //$this->app['router']->enableFilters();
     ini_set('memory_limit', '400M');
     // Temporarily increase memory limit to 400MB
     /**
      * By default, Laravel keeps a log in memory of all queries that have been run for
      * the current request. Disable logging for test to reduce memory.
      */
     \DB::connection()->disableQueryLog();
     $this->artisan('migrate', ['--database' => 'testbench', '--realpath' => realpath(__DIR__ . '/../src/database/migrations')]);
     \Mail::pretend(true);
 }
开发者ID:aguaragazu,项目名称:redminportal,代码行数:18,代码来源:RedminTestCase.php

示例14: setUpBeforeClass

 static function setUpBeforeClass()
 {
     \Config::set('database.default', 'sqlite');
     \Config::set('database.connections.sqlite.database', ':memory:');
     \Config::set('auth.model', 'Innoscience\\Eloquental\\Tests\\Models\\TestUser');
     \Mail::pretend(true);
     \Artisan::call('migrate:install');
     if (stripos(__DIR__, 'workbench') !== FALSE) {
         self::$packagePath = 'workbench/innoscience/eloquental';
     } else {
         if (stripos(__DIR__, 'vendor') !== FALSE) {
             self::$packagePath = 'vendor/innoscience/eloquental';
         }
     }
     \Artisan::call('migrate:rollback');
     \Artisan::call('migrate', array('--path' => self::$packagePath . '/tests/database/migrations'));
     \Artisan::call('db:seed', array('--class' => 'Innoscience\\Eloquental\\Tests\\Database\\Seeds\\EloquentalTestDatabaseSeeder'));
 }
开发者ID:innoscience,项目名称:eloquental,代码行数:18,代码来源:EloquentalTest.php

示例15: setUp

 /**
  * Setup runs before each individual test
  */
 public function setUp()
 {
     parent::setUp();
     // Set test name in globals
     $GLOBALS['PHPUNIT_TEST'] = $this->getName();
     // Set skip magma permission
     //$GLOBALS['MAGMA_SKIP_ACCESS'] = true;
     $models = [];
     $files = File::glob(app_path() . '/models/*.php');
     foreach ($files as $file) {
         $class = basename($file, '.php');
         // Reset event listeners and re-register them
         call_user_func(array($class, 'flushEventListeners'));
         call_user_func(array($class, 'boot'));
     }
     // Migrate the database
     Artisan::call('migrate');
     // Set the mailer to pretend
     Mail::pretend(true);
 }
开发者ID:FebriPratama,项目名称:pop,代码行数:23,代码来源:TestCase.php


注:本文中的Mail::pretend方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。