Chris@18: assertNull($e->getCause()); Chris@18: } Chris@18: Chris@18: public function testGetCauseException() Chris@18: { Chris@18: $cause = new Exception('foo bar'); Chris@18: $e = new PEAR_Exception('I caught an exception', $cause); Chris@18: $this->assertNotNull($e->getCause()); Chris@18: $this->assertInstanceOf('Exception', $e->getCause()); Chris@18: $this->assertEquals($cause, $e->getCause()); Chris@18: } Chris@18: Chris@18: public function testGetCauseMessage() Chris@18: { Chris@18: $cause = new Exception('foo bar'); Chris@18: $e = new PEAR_Exception('I caught an exception', $cause); Chris@18: Chris@18: $e->getCauseMessage($causes); Chris@18: $this->assertEquals('I caught an exception', $causes[0]['message']); Chris@18: $this->assertEquals('foo bar', $causes[1]['message']); Chris@18: } Chris@18: Chris@18: public function testGetTraceSafe() Chris@18: { Chris@18: $e = new PEAR_Exception('oops'); Chris@18: $this->assertInternalType('array', $e->getTraceSafe()); Chris@18: } Chris@18: Chris@18: public function testGetErrorClass() Chris@18: { Chris@18: $e = new PEAR_Exception('oops'); Chris@18: $this->assertEquals('PEAR_ExceptionTest', $e->getErrorClass()); Chris@18: } Chris@18: Chris@18: public function testGetErrorMethod() Chris@18: { Chris@18: $e = new PEAR_Exception('oops'); Chris@18: $this->assertEquals('testGetErrorMethod', $e->getErrorMethod()); Chris@18: } Chris@18: Chris@18: public function test__toString() Chris@18: { Chris@18: $e = new PEAR_Exception('oops'); Chris@18: $this->assertInternalType('string', (string) $e); Chris@18: $this->assertContains('oops', (string) $e); Chris@18: } Chris@18: Chris@18: public function testToHtml() Chris@18: { Chris@18: $e = new PEAR_Exception('oops'); Chris@18: $html = $e->toHtml(); Chris@18: $this->assertInternalType('string', $html); Chris@18: $this->assertContains('oops', $html); Chris@18: } Chris@18: } Chris@18: ?>