oliverdavies.uk-drupal-old/web/modules/custom/blog/tests/src/Kernel/PostTestBase.php
Oliver Davies 62424d5b04 Add PostTestBase
Add a base test for writing kernel tests for posts, so that it will be
easier to start writing the tests for related posts.

References #3
2021-01-10 22:37:28 +00:00

43 lines
834 B
PHP

<?php
namespace Drupal\Tests\opdavies_blog\Kernel;
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
use Drupal\Tests\node\Traits\NodeCreationTrait;
use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait;
abstract class PostTestBase extends EntityKernelTestBase {
use NodeCreationTrait;
use TaxonomyTestTrait;
public static $modules = [
// Core.
'node',
'taxonomy',
'link',
// Contrib.
'discoverable_entity_bundle_classes',
'hook_event_dispatcher',
'core_event_dispatcher',
// Custom.
'opdavies_blog_test',
'opdavies_blog',
];
protected function setUp() {
parent::setUp();
$this->installConfig([
'filter',
'opdavies_blog_test',
]);
$this->installEntitySchema('taxonomy_vocabulary');
$this->installEntitySchema('taxonomy_term');
}
}