You are here

public function ExistenceCheckingTest::entityExistsDataProvider in YAML Content 8

Data provider to prepare entityExists method tests.

@todo Extend data sets for more complete testing.

File

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

Class

ExistenceCheckingTest
Test the existence checking functionality of the ContentLoader class.

Namespace

Drupal\Tests\yaml_content\Unit\ContentLoader

Code

public function entityExistsDataProvider() {

  // Paragraphs should always be recreated since they can't reliably be
  // identified as duplicates without false positives.
  $paragraph_test = [
    // Expected result.
    FALSE,
    // Content data.
    [
      'entity' => 'paragraph',
      'type' => 'test_paragraph_bundle',
      'field_title' => [
        'value' => 'Test Title',
      ],
    ],
    // Callback setup.
    NULL,
  ];

  // Media and file entities require special handling to identify matches.
  // @todo Add tests for media and file content.
  $media_test = [];
  $file_test = [];

  // Nodes should match regularly based on available property data.
  // @todo Test node existence checks with an available match.
  $node_match_test = [];

  // @todo Test node existence checks without an available match.
  $node_no_match_test = [];
  return [
    $paragraph_test,
  ];
}