/** * Sets up the application before every test. * * If you're overwriting this then be sure to call parent::setUp(). */ public function setUp() { if (!class_exists(static::$applicationClass)) { throw new \RuntimeException('Application class "' . static::$applicationClass . '" does not exist. Has it been properly loaded?'); } $appClass = static::$applicationClass; $this->application = new $appClass(); Framework::run($this->application, 'test', true, Framework::MODE_TEST); }
<?php require_once __DIR__ . '/../vendor/autoload.php'; use Splot\Framework\Framework; use Application\App; // detect env based on .tld $tld = end(explode('.', $_SERVER['SERVER_NAME'])); $env = $tld === 'dev' ? 'dev' : 'prod'; $debug = $env === 'dev' ? true : false; Framework::run(new App(), $env, $debug);
/** * Sets up the application before every test. * * If you're overwriting this then be sure to call parent::setUp(). */ public function setUp() { $this->application = new TestApplication(); Framework::run($this->application, 'test', true, Framework::MODE_TEST); }
<?php use Splot\Framework\Framework; $rootDir = __DIR__ . '/..'; require_once $rootDir . '/vendor/autoload.php'; require_once $rootDir . '/app/Application.php'; Framework::run(new Application());