Exemplo n.º 1
0
 public function testInvalidErrorException()
 {
     $F = new \ErrorException();
     $this->assertFalse(ExceptionError::isValid($F));
     $this->assertEquals(ExceptionError::isValid($F), $F instanceof ExceptionError);
     $this->assertInstanceOf(\ErrorException::class, $F);
 }
Exemplo n.º 2
0
 public function testBasicGetSeverityString()
 {
     $E = new ExceptionError();
     $Mirror = new \ReflectionClass($E);
     $MirrorProperty = $Mirror->getProperty('aErrorTypes');
     $MirrorProperty->setAccessible(true);
     $Codes = $MirrorProperty->getValue($E);
     foreach ($Codes as $key => $Code) {
         $CodeValue = constant($Code);
         $this->assertNotEmpty($CodeValue);
         $this->assertEquals($CodeValue, $key);
         $F = new ExceptionError('test' . $key, $key, $key);
         $this->assertEquals($Code, $F->getSeverityString());
         $G = new ExceptionError('test' . $key, $key, $CodeValue);
         $this->assertEquals($Code, $G->getSeverityString());
     }
 }