Пример #1
0
 public function testGetTraceByOffset()
 {
     $err = new \r8\Exception();
     $trace = $err->getTraceByOffset(0);
     $this->assertThat($trace, $this->isInstanceOf('\\r8\\Backtrace\\Event'));
     $this->assertEquals(__FUNCTION__, $trace->getName());
 }
Пример #2
0
 public function testFormat()
 {
     $formatter = new \r8\Error\Formatter\HTML(\r8\Env::request());
     $exception = new \r8\Exception("Test", 5050);
     $exception->addData("key", "data");
     $exception->addData("test", new stdClass());
     $error = new \r8\Error\Exception($exception);
     $result = $formatter->format($error);
     $this->assertType("string", $result);
     $this->assertGreaterThan(0, strlen($result));
 }