本文整理汇总了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();
}
示例2: setUp
/**
* Préparation avant les tests
*/
public function setUp()
{
parent::setUp();
Artisan::call('migrate');
$this->seed();
Mail::pretend(true);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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');
}
示例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);
}
示例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();
}
示例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. ');
});
}
}
示例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);
}
示例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);
}
示例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'));
}
示例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);
}