Rename and re-organise custom modules
- Rename `opd_talks` to `opdavies_talks` - Rename `custom` to `opdavies_blog`
This commit is contained in:
parent
e4e898f22c
commit
9b1a8fb3be
53 changed files with 125 additions and 116 deletions
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\Tests\opdavies_talks\Kernel;
|
||||
|
||||
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
|
||||
use Drupal\node\Entity\Node;
|
||||
use Drupal\opdavies_talks\Entity\Node\Talk;
|
||||
use Drupal\paragraphs\Entity\Paragraph;
|
||||
use Drupal\paragraphs\ParagraphInterface;
|
||||
|
||||
abstract class TalksTestBase extends EntityKernelTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = [
|
||||
// Core.
|
||||
'node',
|
||||
'file',
|
||||
'datetime',
|
||||
|
||||
// Contrib.
|
||||
'discoverable_entity_bundle_classes',
|
||||
'entity_reference_revisions',
|
||||
'paragraphs',
|
||||
'hook_event_dispatcher',
|
||||
|
||||
// Custom.
|
||||
'opdavies_talks',
|
||||
'opdavies_talks_test',
|
||||
];
|
||||
|
||||
protected $strictConfigSchema = FALSE;
|
||||
|
||||
protected function createEvent(array $overrides = []): ParagraphInterface {
|
||||
/** @var \Drupal\paragraphs\ParagraphInterface $event */
|
||||
$event = Paragraph::create(array_merge([
|
||||
'type' => 'event',
|
||||
], $overrides));
|
||||
|
||||
return tap($event)->save();
|
||||
}
|
||||
|
||||
protected function createTalk(array $overrides = []): Talk {
|
||||
$talk = Node::create(array_merge([
|
||||
'title' => 'Test Driven Drupal',
|
||||
'type' => 'talk',
|
||||
], $overrides));
|
||||
|
||||
return tap($talk)->save();
|
||||
}
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->installEntitySchema('paragraph');
|
||||
$this->installSchema('node', ['node_access']);
|
||||
|
||||
$this->installConfig(['opdavies_talks_test']);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue