4h: Ensure that only articles are returned

This commit is contained in:
Oliver Davies 2020-11-14 09:35:10 +00:00
parent 40228b36f4
commit 1be8440519

View file

@ -27,6 +27,18 @@ class ArticleRepositoryTest extends EntityKernelTestBase {
$this->assertSame('Test post', $articles[1]->label()); $this->assertSame('Test post', $articles[1]->label());
} }
/** @test */
public function nodes_that_are_not_articles_are_not_returned() {
$this->createNode(['type' => 'article'])->save();
$this->createNode(['type' => 'article'])->save();
$this->createNode(['type' => 'article'])->save();
$repository = $this->container->get(ArticleRepository::class);
$articles = $repository->getAll();
$this->assertCount(3, $articles);
}
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();