예제 #1
0
파일: Bootstrap.php 프로젝트: nxpthx/FLOW3
 /**
  * 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;
 }
예제 #2
0
 /**
  * @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());
 }