HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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
    }
}