File: D:/HostingSpaces/brameda/brameda.nl/app/Komma/Kms/QualityAssurance/TestsController.php
<?php
namespace App\Komma\Kms\QualityAssurance;
/**
* Runs unit / feature / browser tests for the shop
*
* Class TestsController
* @package App\Komma\Shop\
*/
class TestsController extends BaseTestController
{
public function __construct()
{
parent::__construct();
$this->baseDirectory = base_path().DIRECTORY_SEPARATOR;
$this->testsFolder = $this->baseDirectory.'Tests'.DIRECTORY_SEPARATOR;
$this->screenshotFolder = $this->baseDirectory.'Tests'.DIRECTORY_SEPARATOR.'Browser'.DIRECTORY_SEPARATOR.'screenshots'.DIRECTORY_SEPARATOR;
}
/**
* Makes sure the application is in an predictable state (always the same).
*/
public function prepareEnvironment()
{
$this->showBanner('Setting up a predictable environment....');
parent::prepareEnvironment();
echo 'Running migrations: '.env('DB_DATABASE').PHP_EOL;
\Artisan::call('migrate');
echo 'Running seeds'.PHP_EOL;
\Artisan::call('db:seed');
echo 'done'.PHP_EOL;
}
/**
* returns true if the controller can run tests, false if not.
*
* @return bool
*/
protected function canTest()
{
return true; //Regular tests can always run
}
}