Пример #1
0
 /**
  * When you have codes that indicate they are to be disabled and
  * there are no coded given from which to disable them from the
  * setLevel will use the current reporting level instead
  *
  * @return null
  */
 public function testSetGetLevelNoEnableWithDisable()
 {
     /* set current reporting level */
     error_reporting(E_ALL | E_STRICT);
     $codes = '-error, -warning, -parse';
     $this->assertNull($this->error->setLevel($codes));
     $level = (E_ALL | E_STRICT) & ~(E_ERROR | E_WARNING | E_PARSE);
     $this->assertEquals($level, error_reporting());
     $result = $this->error->getLevel();
     $this->assertInternalType('array', $result);
     $this->assertArrayHasKey('enabled', $result);
     $this->assertArrayHasKey('disabled', $result);
     $this->assertInternalType('array', $result['enabled']);
     $this->assertInternalType('array', $result['disabled']);
     $this->assertEquals(3, count($result['disabled']));
     $this->assertEquals(12, count($result['enabled']));
     $this->assertContains('error', $result['disabled']);
     $this->assertContains('warning', $result['disabled']);
     $this->assertContains('parse', $result['disabled']);
     $expected = array('notice', 'core_error', 'core_warning', 'compile_error', 'compile_warning', 'user_error', 'user_warning', 'user_notice', 'strict', 'recoverable_error', 'deprecated', 'user_deprecated');
     $this->assertEquals(count($expected), count($result['enabled']));
     foreach ($expected as $code) {
         $this->assertContains($code, $result['enabled']);
     }
 }