update to phpunit8

This commit is contained in:
Dominik Liebler
2019-08-17 23:05:15 +02:00
parent 78ffb07d9c
commit a73c253ffc
10 changed files with 321 additions and 263 deletions

View File

@ -17,7 +17,7 @@ class PostRepositoryTest extends TestCase
*/
private $repository;
protected function setUp()
protected function setUp(): void
{
$this->repository = new PostRepository(new InMemoryPersistence());
}
@ -27,12 +27,11 @@ class PostRepositoryTest extends TestCase
$this->assertEquals(1, $this->repository->generateId()->toInt());
}
/**
* @expectedException \OutOfBoundsException
* @expectedExceptionMessage Post with id 42 does not exist
*/
public function testThrowsExceptionWhenTryingToFindPostWhichDoesNotExist()
{
$this->expectException(\OutOfBoundsException::class);
$this->expectExceptionMessage('Post with id 42 does not exist');
$this->repository->findById(PostId::fromInt(42));
}