You are here

public function SplitFilterTest::testFilterListAll in Configuration Split 8

Test that the filter lists all correctly.

File

src/Tests/SplitFilterTest.php, line 430

Class

SplitFilterTest
Test filter plugin.

Namespace

Drupal\config_split\Tests

Code

public function testFilterListAll() {

  // Set up random config storage.
  $primary = (array) $this
    ->getRandomGenerator()
    ->object(rand(3, 10));
  $secondary = (array) $this
    ->getRandomGenerator()
    ->object(rand(3, 10));
  $merged = array_merge($primary, $secondary);
  $storage = $this
    ->getConfigStorageStub($secondary);
  $transparent = $this
    ->getFilter(NULL);
  $filter = $this
    ->getFilter($storage);

  // Test listing config.
  $this
    ->assertArrayEquals(array_keys($primary), $transparent
    ->filterListAll('', array_keys($primary)));
  $this
    ->assertArrayEquals(array_keys($merged), $filter
    ->filterListAll('', array_keys($primary)));
}