public function test()
 {
     $exception = new ErrorException(E_NOTICE, 'message', 'file', 0, 1);
     $this->assertSame(E_NOTICE, $exception->getSeverity());
     $this->assertSame('message', $exception->getMessage());
     $this->assertSame('Notice', $exception->getSeverityAsString());
     $this->assertSame('E_NOTICE', $exception->getSeverityAsConstantName());
     $this->assertSame('file', $exception->getFile());
     $this->assertSame(0, $exception->getLine());
     $sourceTrace = array_slice($exception->getTrace(), 1);
     $this->assertSame($sourceTrace, $exception->getSourceTrace());
     $this->assertSame(StackTraceFormatter::format($exception->getSourceTrace()), $exception->getSourceTraceAsString());
     $this->assertSame('exception \'Hyperframework\\Common\\ErrorException\' ' . "with message 'message' in file:0" . PHP_EOL . 'Stack trace:' . PHP_EOL . $exception->getSourceTraceAsString(), (string) $exception);
 }
 /**
  * @return string
  */
 public function getSourceTraceAsString()
 {
     $trace = $this->getSourceTrace();
     return StackTraceFormatter::format($trace);
 }
 public function testFormat()
 {
     $trace = [['function' => 'test'], ['function' => 'test2']];
     $this->assertSame('#0 [internal function]: test()' . PHP_EOL . '#1 [internal function]: test2()' . PHP_EOL . '#2 {main}', StackTraceFormatter::format($trace));
 }