ReplicationSettingsTest.php in Replication 8
File
tests/src/Kernel/ReplicationSettingsTest.php
View source
<?php
namespace Drupal\Tests\replication\Kernel;
use Drupal\KernelTests\KernelTestBase;
class ReplicationSettingsTest extends KernelTestBase {
public static $modules = [
'user',
'serialization',
'key_value',
'multiversion',
'replication',
];
public function testCreation() {
$this
->installEntitySchema('replication_settings');
$entityTypeManager = $this->container
->get('entity_type.manager');
$entity = $entityTypeManager
->getStorage('replication_settings')
->create([
'id' => 'test',
'label' => 'Replication settings test',
'filter_id' => 'entity_type',
'parameters' => [
'entity_type_id' => 'node',
'bundle' => 'article',
],
]);
$entity
->save();
$entity = $entityTypeManager
->getStorage('replication_settings')
->load('test');
$this
->assertEquals($entity
->id(), 'test', 'Test replication settings config entity successfully saved.');
}
}