コード例 #1
0
 public function clearOutputHandlers()
 {
     $self = $this;
     ErrorReporting::invokeWith(E_NOTICE, function () use($self) {
         while ($self->getNestingLevel()) {
             $self->clearOutputHandler();
         }
     });
 }
コード例 #2
0
 public function testRemove()
 {
     $reset = ErrorReporting::get();
     // normal behavior
     ErrorReporting::set($reset | E_ERROR);
     $before = ErrorReporting::get();
     $success = ErrorReporting::remove(E_ERROR);
     $after = ErrorReporting::get();
     $this->assertTrue($success);
     $this->assertEquals(ErrorReporting::get(), $after);
     $this->assertNotEquals($before, $after);
     $this->assertEquals($before ^ E_ERROR, $after);
     // try to remove a level that is not active
     $this->assertFalse(ErrorReporting::remove(E_ERROR));
     // reset to the real value
     error_reporting($reset);
 }