/** * Constructor * * @param string $context The application context, for example "Production" or "Development" */ public function __construct($context) { $this->defineConstants(); $this->ensureRequiredEnvironment(); $this->context = new ApplicationContext($context); if ($this->context->isTesting()) { require_once 'PHPUnit/Autoload.php'; require_once FLOW3_PATH_FLOW3 . 'Tests/BaseTestCase.php'; require_once FLOW3_PATH_FLOW3 . 'Tests/FunctionalTestCase.php'; } $this->earlyInstances[__CLASS__] = $this; }
/** * @test * @dataProvider isMethods */ public function contextMethodsReturnTheCorrectValues($contextName, $isDevelopment, $isProduction, $isTesting, $parentContext) { $context = new ApplicationContext($contextName); $this->assertSame($isDevelopment, $context->isDevelopment()); $this->assertSame($isProduction, $context->isProduction()); $this->assertSame($isTesting, $context->isTesting()); $this->assertSame((string) $parentContext, (string) $context->getParent()); }