コード例 #1
0
 /**
  * @return common_configuration_Report
  */
 public function check()
 {
     if (version_compare(phpversion(), '7.0.0', '>=')) {
         return new common_configuration_Report(common_configuration_Report::VALID, 'opcache.load_comments is not a configurable option any more for php > 7', $this);
     }
     $iniSettingCheck = new common_configuration_PHPINIValue('1', 'opcache.load_comments');
     $result = $iniSettingCheck->check();
     $result->setComponent($this);
     return $result;
 }
コード例 #2
0
ファイル: ConfigurationTest.php プロジェクト: oat-sa/generis
 public function testPHPIniValues()
 {
     // core tests.
     $ini = new common_configuration_PHPINIValue('text/html', 'default_mimetype');
     $this->assertEquals($ini->getName(), 'default_mimetype');
     $this->assertEquals($ini->isOptional(), false);
     $this->assertEquals($ini->getExpectedValue(), 'text/html');
     $ini->setOptional(true);
     $this->assertEquals($ini->isOptional(), true);
     $ini->setName('foobar');
     $this->assertEquals($ini->getName(), 'foobar');
     $ini->setExpectedValue('text/xml');
     $this->assertEquals($ini->getExpectedValue(), 'text/xml');
     // String INI Option test.
     $ini->setName('default_mimetype');
     $ini->setExpectedValue('text/html');
     $oldIniValue = ini_get($ini->getName());
     ini_set($ini->getName(), 'text/html');
     $report = $ini->check();
     $this->assertEquals($report->getStatus(), common_configuration_Report::VALID);
     $this->assertEquals($report->getStatusAsString(), 'valid');
     ini_set($ini->getName(), 'text/xml');
     $report = $ini->check();
     $this->assertEquals($report->getStatus(), common_configuration_Report::INVALID);
     $this->assertEquals($report->getStatusAsString(), 'invalid');
     $ini->setName('foobar');
     $report = $ini->check();
     $this->assertEquals($report->getStatus(), common_configuration_Report::UNKNOWN);
     $this->assertEquals($report->getStatusAsString(), 'unknown');
     ini_set($ini->getName(), $oldIniValue);
 }