You are here

public function EntityTypeFilterTest::filterTestProvider in Replication 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/Plugin/ReplicationFilter/EntityTypeFilterTest.php \Drupal\Tests\replication\Unit\Plugin\ReplicationFilter\EntityTypeFilterTest::filterTestProvider()

Provide test cases for the "entity_type_id" and "bundle" parameters.

File

tests/src/Unit/Plugin/ReplicationFilter/EntityTypeFilterTest.php, line 53

Class

EntityTypeFilterTest
Tests that the entity type filter parses parameters correctly.

Namespace

Drupal\Tests\replication\Unit\Plugin\ReplicationFilter

Code

public function filterTestProvider() {
  return [
    // Test singular parameter values.
    [
      [
        'node',
      ],
      TRUE,
    ],
    [
      [
        'node.article',
      ],
      TRUE,
    ],
    [
      [
        'node.page',
      ],
      FALSE,
    ],
    // Test multiple parameter values.
    [
      [
        'block',
        'node',
      ],
      TRUE,
    ],
    [
      [
        'node.article',
        'node.page',
      ],
      TRUE,
    ],
    [
      [
        'node.page',
        'node.article',
      ],
      TRUE,
    ],
    [
      [
        'node.test',
        'node.page',
      ],
      FALSE,
    ],
    // Test bad data that might be entered into the parameters:
    [
      [
        '',
      ],
      FALSE,
    ],
    [
      [
        ',',
      ],
      FALSE,
    ],
    [
      [
        ',node',
      ],
      FALSE,
    ],
    [
      [
        '..',
      ],
      FALSE,
    ],
    [
      [
        NULL,
      ],
      FALSE,
    ],
    [
      [
        FALSE,
      ],
      FALSE,
    ],
    [
      [
        TRUE,
      ],
      FALSE,
    ],
    [
      [
        0,
      ],
      FALSE,
    ],
  ];
}