public function __construct(Application $application) { $this->setUpEnvironment($application); $this->setUpDatabase($application); $this->application = $application; TestCase::setApplication($application); $factoryGirl = new FactoryGirl(['factoryPaths' => [$application->config()['paths']['root']->expand('test', 'factories')]]); TestCase::setFactoryGirl($factoryGirl); }