4g: Add more assertions
This commit is contained in:
parent
3723a0af0e
commit
40228b36f4
|
@ -4,6 +4,7 @@ namespace Drupal\Tests\my_module\Kernel;
|
|||
|
||||
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
|
||||
use Drupal\my_module\Repository\ArticleRepository;
|
||||
use Drupal\node\NodeInterface;
|
||||
use Drupal\Tests\node\Traits\NodeCreationTrait;
|
||||
|
||||
class ArticleRepositoryTest extends EntityKernelTestBase {
|
||||
|
@ -20,6 +21,10 @@ class ArticleRepositoryTest extends EntityKernelTestBase {
|
|||
$articles = $repository->getAll();
|
||||
|
||||
$this->assertCount(1, $articles);
|
||||
$this->assertIsObject($articles[1]);
|
||||
$this->assertInstanceOf(NodeInterface::class, $articles[1]);
|
||||
$this->assertSame('article', $articles[1]->bundle());
|
||||
$this->assertSame('Test post', $articles[1]->label());
|
||||
}
|
||||
|
||||
protected function setUp() {
|
||||
|
|
Loading…
Reference in a new issue