示例#1
0
 /**
  * Refresh the application instance.
  *
  * @return void
  */
 protected function refreshApplication()
 {
     $this->app = $this->createApplication();
     $this->client = $this->createClient();
     $this->app->setRequestForConsoleEnvironment();
     $this->app->boot();
 }
示例#2
0
 public function _before(\Codeception\TestCase $test)
 {
     $this->kernel = $this->getApplication();
     $this->kernel->boot();
     $this->kernel->setRequestForConsoleEnvironment();
     $this->client = new LaravelConnector($this->kernel);
     $this->client->followRedirects(true);
     if ($this->config['filters']) {
         $this->haveEnabledFilters();
     }
     if ($this->transactionCleanup()) {
         $this->kernel['db']->beginTransaction();
     }
 }
示例#3
0
 /**
  * Refresh the application instance.
  *
  * @param \Illuminate\Foundation\Application $app Optionally provide your own unbooted
  *                                                Laravel Application instance. This
  *                                                parameter can largely be ignored and
  *                                                is used just for unit testing
  * @return void
  */
 public function refreshApplication($app = null)
 {
     $this->app = $app instanceof Application ? $app : $this->createApplication();
     $this->app->setRequestForConsoleEnvironment();
     $this->app->boot();
     if ($this->migrateDatabase) {
         $artisan = $this->app->make('artisan');
         try {
             $artisan->call('migrate:install');
         } catch (QueryException $e) {
             // migration table is already installed
         }
         $artisan->call('migrate:refresh');
         if ($this->seedDatabase) {
             $artisan->call('db:seed', array('--class' => $this->seedClass));
         }
     }
 }
示例#4
0
 /**
  * Set the application request for the console environment.
  *
  * @return void 
  * @static 
  */
 public static function setRequestForConsoleEnvironment()
 {
     \Illuminate\Foundation\Application::setRequestForConsoleEnvironment();
 }