Example #1
0
 /**
  * Nearly identical to the `testCreateUsingFormat()` test, but this time
  * a `$previous` exception will be passed. The message should be the same
  * as before, but the `$previous` exception must be returned this time.
  */
 public function testCreateUsingFormatWithPrevious()
 {
     $previous = new \Exception('The previous exception.');
     $exception = Exception::createUsingFormat('This is %s %drd message.', 'my', 3, $previous);
     $this->assertInstanceOf('Phine\\Exception\\Exception', $exception);
     $this->assertEquals('This is my 3rd message.', $exception->getMessage());
     $this->assertSame($previous, $exception->getPrevious());
 }