You are here

public function ExistenceCheckingTest::testEntityExists in YAML Content 8

Tests the entityExists method.

@dataProvider entityExistsDataProvider

Parameters

bool $expected: The expected result from the entityExists() method using these arguments.

array $content_data: The content data being tested.

callable|null $setupCallback: (Optional) A callback function to be used to prepare for this specific content test.

See also

\Drupal\yaml_content\ContentLoader\ContentLoader::entityExists()

File

tests/src/Unit/ContentLoader/ExistenceCheckingTest.php, line 313

Class

ExistenceCheckingTest
Test the existence checking functionality of the ContentLoader class.

Namespace

Drupal\Tests\yaml_content\Unit\ContentLoader

Code

public function testEntityExists($expected, array $content_data, $setupCallback = NULL) {

  // Execute the callback function for this test case if provided.
  if (is_callable($setupCallback)) {
    call_user_func($setupCallback);
  }
  $entity_type = $content_data['entity'];
  $actual = $this->contentLoader
    ->entityExists($entity_type, $content_data);
  $this
    ->assertEquals($expected, $actual);
  $this
    ->markTestIncomplete();
}