You are here

public function PublishedFilterTest::testDefaultConfig in Replication 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/Plugin/ReplicationFilter/PublishedFilterTest.php \Drupal\Tests\replication\Kernel\Plugin\ReplicationFilter\PublishedFilterTest::testDefaultConfig()

Test default configuration for published filter.

File

tests/src/Kernel/Plugin/ReplicationFilter/PublishedFilterTest.php, line 89

Class

PublishedFilterTest
Tests that the published filter parses parameters correctly.

Namespace

Drupal\Tests\replication\Kernel\Plugin\ReplicationFilter

Code

public function testDefaultConfig() {

  /** @var \Drupal\replication\Plugin\ReplicationFilterManagerInterface $filter_manager */
  $filter_manager = $this->container
    ->get('plugin.manager.replication_filter');
  $filter = $filter_manager
    ->createInstance('published');
  $entity = $this->container
    ->get('entity_type.manager')
    ->getStorage('block_content')
    ->create([
    'type' => 'test',
  ]);
  $value = $filter
    ->filter($entity);

  // By default entities with no status entity key are filtered out.
  $this
    ->assertFalse($value);
}