Пример #1
0
 /**
  * @param bool $enabled
  */
 protected function setDebugMode($enabled)
 {
     $configValues = ConfigHelper::getDummyConfig();
     $configValues['DEBUG'] = $enabled ? 1 : 0;
     ConfigHelper::setEnvironmentVariables($configValues);
     ConfigHelper::unsetConfigInstance();
 }
Пример #2
0
 public function testShouldNotLogDebugMessagesIfDebugModeIsNotEnabled()
 {
     $configValues = ConfigHelper::getDummyConfig();
     $configValues['DEBUG'] = 0;
     ConfigHelper::setEnvironmentVariables($configValues);
     ConfigHelper::unsetConfigInstance();
     $this->expectOutputRegex('/^((?!\\[DEBUG\\]).)*$/');
     // Output containing [DEBUG] should not be present
     $this->component->debug('Foo %s', 'bar');
 }
Пример #3
0
 public function testShouldNotDumpDataIfDebugModeIsNotEnabled()
 {
     // disable debug mode
     $configValues = ConfigHelper::getDummyConfig();
     $configValues['DEBUG'] = 0;
     ConfigHelper::setEnvironmentVariables($configValues);
     ConfigHelper::unsetConfigInstance();
     $object = new StringableObject('foobar string');
     $legacy = new Legacy($this->testCase);
     $legacy->setFileDir(sys_get_temp_dir());
     $legacy->saveWithName($object, 'object');
     $this->expectOutputRegex('/^((?!foobar string).)*$/s');
     // Output should not contain the string
 }
Пример #4
0
 protected function setUp()
 {
     $this->environmentVariables = ConfigHelper::getDummyConfig();
     ConfigHelper::unsetConfigInstance();
 }
Пример #5
0
 /**
  * @expectedException \RuntimeException
  * @expectedExceptionMessage Directory "/notexisting" does not exist or is not writeable.
  */
 public function testShouldFailIfGivenDirectoryDoesNotExists()
 {
     $configValues = ConfigHelper::getDummyConfig();
     $configValues['LOGS_DIR'] = '/notexisting';
     ConfigHelper::setEnvironmentVariables($configValues);
     ConfigHelper::unsetConfigInstance();
     $publisher = new XmlPublisher(null, null, null);
     $publisher->publishResult('testCaseNameFoo', 'testNameBar', 'started');
 }