src/Database/Migration.php
/**
	 * Runs the migration as a test, with all queries intercepted and validated for syntax errors.
	 *
	 * @param Migrator $migrator
	 * @return SchemaStatement[]
	 */
Runs the migration as a test, with all queries intercepted and validated for syntax errors.
@param Migrator $migrator
@return SchemaStatement[]
Runs the migration as a test with all queries intercepted and validated for syntax errors . @param Migrator $migrator @return SchemaStatement []
private function runAsTest(Migrator $migrator) {
		$connectionName = $this->getConnectionName();
		Application::kernel()->database()->validationMode(true);
		$this->bucket->start();
		try {
			Schema::withDefaultConnection($connectionName, function() use($migrator) {
				$this->executeDirectionMethod($migrator);
			});
		}
		catch (Exception $ex) {
			$this->bucket->stop();
			Application::kernel()->database()->validationMode(false);
			if (!($ex instanceof DatabaseException)) {
				throw $ex;
			}
			return $this->bucket->all();
		}
		$this->bucket->stop();
		Application::kernel()->database()->validationMode(false);
		return $this->bucket->all();
	}
private function runAsTest ( Migrator $ migrator ) { $ connectionName = $ this -> getConnectionName ( ) ; Application :: kernel ( ) -> database ( ) -> validationMode ( true ) ; $ this -> bucket -> start ( ) ; try { Schema :: withDefaultConnection ( $ connectionName , function ( ) use ( $ migrator ) { $ this -> executeDirectionMethod ( $ migrator ) ; } ) ; } catch ( Exception $ ex ) { $ this -> bucket -> stop ( ) ; Application :: kernel ( ) -> database ( ) -> validationMode ( false ) ; if ( ! ( $ ex instanceof DatabaseException ) ) { throw $ ex ; } return $ this -> bucket -> all ( ) ; } $ this -> bucket -> stop ( ) ; Application :: kernel ( ) -> database ( ) -> validationMode ( false ) ; return $ this -> bucket -> all ( ) ; }
Runs the migration as a test, with all queries intercepted and validated for syntax errors.
Runs the migration as a test with all queries intercepted and validated for syntax errors .
// Start monitoring and validating queries // Run the migration as normal, but catch exceptions so we can stop the bucket // Database exceptions will be logged in the bucket and shouldn't be thrown