5b: Add a test for which nodes are wrappable
If we attempt to wrap a node which is not an article, we expect an Exception to be thrown. As one currently isn’t, the test will fail.
This commit is contained in:
parent
7823e56b09
commit
76172f4667
1 changed files with 10 additions and 0 deletions
|
@ -21,5 +21,15 @@ class ArticleWrapperTest extends UnitTestCase {
|
|||
$this->assertSame('article', $articleWrapper->getOriginal()->bundle());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_throws_an_exception_if_the_node_is_not_an_article() {
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
$page = $this->createMock(NodeInterface::class);
|
||||
$page->method('bundle')->willReturn('page');
|
||||
|
||||
new ArticleWrapper($page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue