示例#1
0
 public function testInstantiation()
 {
     $exception = new MethodNotAllowed(9, [1, 2, 3]);
     $this->assertEquals('Method Not Allowed', $exception->getMessage());
     $this->assertEquals(405, $exception->getStatusCode());
     $this->assertEquals(9, $exception->getCode());
     $this->assertEquals([1, 2, 3], $exception->getDetails());
 }
示例#2
0
 public function testExceptionWithPreviousOne()
 {
     $exception = new MethodNotAllowed('my method name', new \Exception('my previous exception'));
     $this->assertSame('Method my method name not allowed', $exception->getMessage());
     $this->assertSame(405, $exception->getResponseCode());
 }