/** * 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(); }
/** * Préparation avant les tests */ public function setUp() { parent::setUp(); Artisan::call('migrate'); $this->seed(); Mail::pretend(true); }
public function setUp() { parent::setUp(); \Mail::pretend(true); $this->to = ['address' => '*****@*****.**', 'name' => 'foobar']; \Config::set('mailform.delivery_to', $this->to); }
/** * 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(); }
/** * 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); }
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); }
/** * 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); }
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'); }
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); }
/** * 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(); }
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. '); }); } }
/** * 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); }
/** * 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); }
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')); }
/** * 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); }
/** * Setup the laravel application and run migrations when we first start */ public static function setUpBeforeClass() { ini_set('memory_limit', '-1'); $unitTesting = true; $testEnvironment = 'testing'; $GLOBALS['manuallyRequireDeviseRoutes'] = true; if (!static::$setup) { $loader = (require __DIR__ . '/../vendor/autoload.php'); $loader->setPsr4("App\\", __DIR__ . "/integrated/app/"); static::$application = (require __DIR__ . '/integrated/bootstrap/app.php'); static::$application->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); Config::set('database.default', 'sqlite'); static::setUpFixtures(); static::runMigrations(); Artisan::call('db:seed', array('--class' => 'DeviseSeeder')); Artisan::call('db:seed', array('--class' => 'DeviseTestsOnlySeeder')); static::manuallyRequireRoutes(); Mail::pretend(true); static::$setup = true; } return static::$application; }
public function createApplication() { $config_folder = __DIR__ . '/../../../config/testing/'; $mw_file = $config_folder . 'microweber.php'; if (!is_dir($config_folder)) { mkdir($config_folder); } file_put_contents($mw_file, "<?php return array (\n 'is_installed' => 0,\n );"); $unitTesting = true; $testEnvironment = 'testing'; $app = (require __DIR__ . '/../../../bootstrap/app.php'); $app->make('Illuminate\\Contracts\\Console\\Kernel')->bootstrap(); $this->assertEquals(true, is_dir($config_folder)); $this->sqlite_file = storage_path() . '/phpunit.sqlite'; // make fresh install $install_params = array('username' => 'test', 'password' => 'test', 'email' => '*****@*****.**', 'db_driver' => 'sqlite', 'db_host' => '', 'db_user' => '', 'db_pass' => '', 'db_name' => $this->sqlite_file, '--env' => 'testing'); $is_installed = mw_is_installed(); if (!$is_installed) { $install = \Artisan::call('microweber:install', $install_params); $this->assertEquals(0, $install); } \Mail::pretend(true); return $app; }
public function prepareForTests() { Mail::pretend(true); }
/** * Migrates the database and set the mailer to 'pretend'. * This will cause the tests to run quickly. * */ private function prepareForTests() { Artisan::call('migrate'); $this->seed(); Mail::pretend(true); }
public function test() { // $this->client->request('GET', '/cr'); Artisan::call('migrate'); Mail::pretend(true); }
public function testBootup() { Artisan::call('db:seed', ['--class' => 'TestSeeder']); Mail::pretend(true); }
/** * Migrates the database and set the mailer to 'pretend'. * This will cause the tests to run quickly. * */ protected function prepareForTests() { Artisan::call('migrate'); Mail::pretend(true); $this->seed('TestSeeder'); }
/** * Migrates the database and set the mailer to 'pretend'. * This will cause the tests to run quickly. * */ private function prepareForTests() { // Config::set('database.default', 'sqlite_testing'); Artisan::call('migrate'); Mail::pretend(true); }
/** * Migrate the database */ private function prepareForTests() { Mail::pretend(true); Artisan::call('migrate'); }
private function prepareDbForTests() { Artisan::call('zbase:migrate'); Mail::pretend(true); }
private function prepareDatabase() { Artisan::call('migrate'); Artisan::call('db:seed'); Mail::pretend(true); }
public function setUp() { parent::setUp(); DB::beginTransaction(); Mail::pretend(); }
public function setUp() { parent::setUp(); \Mail::pretend(true); }