4d: Add the ArticleRepository

Create the `ArticleRepository` class and add it as a service.

This fails as there is no `getAll()` method on the class.
This commit is contained in:
Oliver Davies 2020-03-19 21:10:12 +00:00
parent 0c518d3d37
commit 54b306844f
3 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,2 @@
services:
Drupal\my_module\Repository\ArticleRepository: ~

View file

@ -0,0 +1,8 @@
<?php
namespace Drupal\my_module\Repository;
class ArticleRepository {
}

View file

@ -3,9 +3,14 @@
namespace Drupal\Tests\my_module\Kernel;
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
use Drupal\my_module\Repository\ArticleRepository;
class ArticleRepositoryTest extends EntityKernelTestBase {
public static $modules = [
'my_module',
];
/** @test */
public function nodes_that_are_not_articles_are_not_returned() {
$repository = $this->container->get(ArticleRepository::class);