4g: Add an article
This commit is contained in:
parent
9b7d9b3feb
commit
48c2724736
|
@ -4,13 +4,18 @@ namespace Drupal\Tests\my_module\Kernel;
|
|||
|
||||
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
|
||||
use Drupal\my_module\Repository\ArticleRepository;
|
||||
use Drupal\Tests\node\Traits\NodeCreationTrait;
|
||||
|
||||
class ArticleRepositoryTest extends EntityKernelTestBase {
|
||||
|
||||
use NodeCreationTrait;
|
||||
|
||||
public static $modules = ['node', 'my_module'];
|
||||
|
||||
/** @test */
|
||||
public function it_returns_blog_posts() {
|
||||
$this->createNode(['type' => 'article', 'title' => 'Test post'])->save();
|
||||
|
||||
$repository = $this->container->get(ArticleRepository::class);
|
||||
$articles = $repository->getAll();
|
||||
|
||||
|
|
Loading…
Reference in a new issue