Add a test the Exception is thrown

This commit is contained in:
Oliver Davies 2024-01-20 09:28:22 +00:00
parent 196b1f1517
commit 9f175475c5

View file

@ -24,4 +24,17 @@ final class PostWrapperTest extends UnitTestCase {
self::assertSame('post', $wrapper->getType());
}
/**
* @test
* @testdox It can't wrap a page
*/
public function it_cant_wrap_a_page(): void {
self::expectException(\InvalidArgumentException::class);
$node = $this->createMock(NodeInterface::class);
$node->method('bundle')->willReturn('page');
new PostWrapper($node);
}
}