4j: Only published articles are returned
This commit is contained in:
parent
2cae42ba3a
commit
a540f4ad32
1 changed files with 14 additions and 0 deletions
|
@ -41,6 +41,20 @@ class ArticleRepositoryTest extends EntityKernelTestBase {
|
||||||
$this->assertCount(3, $articles);
|
$this->assertCount(3, $articles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @test */
|
||||||
|
public function only_published_articles_are_returned() {
|
||||||
|
$this->createNode(['type' => 'article', 'status' => NodeInterface::PUBLISHED])->save();
|
||||||
|
$this->createNode(['type' => 'article', 'status' => NodeInterface::NOT_PUBLISHED])->save();
|
||||||
|
$this->createNode(['type' => 'article', 'status' => NodeInterface::PUBLISHED])->save();
|
||||||
|
$this->createNode(['type' => 'article', 'status' => NodeInterface::NOT_PUBLISHED])->save();
|
||||||
|
$this->createNode(['type' => 'article', 'status' => NodeInterface::PUBLISHED])->save();
|
||||||
|
|
||||||
|
$repository = $this->container->get(ArticleRepository::class);
|
||||||
|
$articles = $repository->getAll();
|
||||||
|
|
||||||
|
$this->assertCount(3, $articles);
|
||||||
|
}
|
||||||
|
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue