From d91283c996fec789c9f14a914fae1b57d9b1a113 Mon Sep 17 00:00:00 2001 From: Tim Turnquist Date: Fri, 14 Dec 2018 15:33:02 -0600 Subject: [PATCH 1/2] setExpectedException depricated? setExpectedException didn't work for me, but when I made the suggested change it worked fine. Based on https://github.com/Roave/BetterReflection/issues/170 --- doc/book/unit-testing.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/book/unit-testing.md b/doc/book/unit-testing.md index 6dcad88..0bc75cb 100644 --- a/doc/book/unit-testing.md +++ b/doc/book/unit-testing.md @@ -766,10 +766,8 @@ public function testExceptionIsThrownWhenGettingNonExistentAlbum() ->select(['id' => 123]) ->willReturn($resultSet->reveal()); - $this->setExpectedException( - RuntimeException::class, - 'Could not find row with identifier 123' - ); + $this->expectException (RuntimeException::class); + $this->expectExceptionMessage('Could not find row with identifier 123'); $this->albumTable->getAlbum(123); } ``` From e30ed96df338170198677b7f76321efc55b49ef1 Mon Sep 17 00:00:00 2001 From: Tim Turnquist Date: Mon, 17 Dec 2018 09:15:01 -0600 Subject: [PATCH 2/2] Removed unneeded space --- doc/book/unit-testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/book/unit-testing.md b/doc/book/unit-testing.md index 0bc75cb..3ff1449 100644 --- a/doc/book/unit-testing.md +++ b/doc/book/unit-testing.md @@ -766,7 +766,7 @@ public function testExceptionIsThrownWhenGettingNonExistentAlbum() ->select(['id' => 123]) ->willReturn($resultSet->reveal()); - $this->expectException (RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Could not find row with identifier 123'); $this->albumTable->getAlbum(123); }