You are here

public function PatternMatchingTest::testEverythingAndNothing in Config Ignore 8.2

Test the cases that are not allowed in testPatternMatching.

File

tests/src/Unit/PatternMatchingTest.php, line 115

Class

PatternMatchingTest
Test the pattern matching.

Namespace

Drupal\Tests\config_ignore\Unit

Code

public function testEverythingAndNothing() {
  $method = new \ReflectionMethod(IgnoreFilter::class, 'matchConfigName');
  $method
    ->setAccessible(TRUE);
  $none = new IgnoreFilter([
    'ignored' => [],
  ], 'config_ignore', [], new MemoryStorage());
  $all = new IgnoreFilter([
    'ignored' => [
      '*',
    ],
  ], 'config_ignore', [], new MemoryStorage());
  static::assertFalse($method
    ->invoke($none, $this
    ->randomMachineName()));
  static::assertTrue($method
    ->invoke($all, $this
    ->randomMachineName()));
}