feat(blog): use the article repository
Use the `ArticleRepository` within `BlogPageController` to load and retrieve article nodes.
This commit is contained in:
parent
f09464f9f7
commit
7e3324b77f
3 changed files with 50 additions and 1 deletions
|
@ -30,4 +30,21 @@ final class BlogPageTest extends BrowserTestBase {
|
|||
$assert->pageTextContains('Welcome to my blog!');
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_shows_articles(): void {
|
||||
$this->createContentType(['type' => 'article']);
|
||||
|
||||
$this->createNode([
|
||||
'title' => 'This is a test article',
|
||||
'type' => 'article',
|
||||
]);
|
||||
|
||||
$this->drupalGet('/blog');
|
||||
|
||||
$assert = $this->assertSession();
|
||||
|
||||
$assert->statusCodeEquals(Response::HTTP_OK);
|
||||
$assert->pageTextContains('This is a test article');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue