You are here

protected function StubTestTrait::performStubTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/src/Tests/StubTestTrait.php \Drupal\migrate_drupal\Tests\StubTestTrait::performStubTest()
  2. 9 core/modules/migrate_drupal/src/Tests/StubTestTrait.php \Drupal\migrate_drupal\Tests\StubTestTrait::performStubTest()

Tests that a stub of the given entity type results in a valid entity.

Parameters

string $entity_type_id: The entity type we are stubbing.

8 calls to StubTestTrait::performStubTest()
MigrateBlockContentStubTest::testStubSuccess in core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php
Tests creation of block content stubs when there is a block_content_type.
MigrateCommentStubTest::testStub in core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php
Tests creation of comment stubs.
MigrateFileStubTest::testStub in core/modules/file/tests/src/Kernel/Migrate/MigrateFileStubTest.php
Tests creation of file stubs.
MigrateMenuLinkContentStubTest::testStub in core/modules/menu_link_content/tests/src/Kernel/Migrate/MigrateMenuLinkContentStubTest.php
Tests creation of menu link content stubs.
MigrateNodeStubTest::testStub in core/modules/node/tests/src/Kernel/Migrate/MigrateNodeStubTest.php
Tests creation of node stubs.

... See full list

File

core/modules/migrate_drupal/src/Tests/StubTestTrait.php, line 18

Class

StubTestTrait
Provides common functionality for testing stubbing.

Namespace

Drupal\migrate_drupal\Tests

Code

protected function performStubTest($entity_type_id) {
  $entity_id = $this
    ->createEntityStub($entity_type_id);
  $this
    ->assertNotEmpty($entity_id, 'Stub successfully created');

  // When validateStub fails, it will return an array with the violations.
  $this
    ->assertEmpty($this
    ->validateStub($entity_type_id, $entity_id));
}