Beispiel #1
0
 public function testCanTellIfExceptionASymptom()
 {
     // fixture doesn't have a cause
     $this->assertFalse($this->fixture->hasCause());
     $this->assertNull($this->fixture->getCause());
     $this->assertFalse($this->fixture->wasCausedBy("Exception"));
     // these fixture do have a root cause
     $this->assertTrue($this->fixtureWithRootCause->hasCause());
     $this->assertTrue($this->fixtureWithSymptom->hasCause());
 }
Beispiel #2
0
 public function next()
 {
     // we can go no further if we're already off the end
     // of this list
     if ($this->current === null) {
         return false;
     }
     // if we are at the end of the list, time to fall off
     // the end
     //
     // the last item in the list can be one of two types
     // of Exception:
     //
     // a) A generic PHP 5 Exception object, or
     // b) A framework Exception that has no cause data
     if (!$this->current instanceof MF_Exception_Enterprise || !$this->current->hasCause()) {
         $this->current = null;
         $this->level++;
         return false;
     }
     // if we get here, then we have not yet reached the end
     // of the list
     $this->current = $this->current->getCause();
     $this->level++;
     return true;
 }