function StubTestTrait::performStubTest

Same name in this branch
  1. 11.x core/modules/migrate_drupal/src/Tests/StubTestTrait.php \Drupal\migrate_drupal\Tests\StubTestTrait::performStubTest()
Same name and namespace in other branches
  1. 10 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()
  3. 8.9.x core/modules/migrate_drupal/src/Tests/StubTestTrait.php \Drupal\migrate_drupal\Tests\StubTestTrait::performStubTest()
  4. main core/modules/migrate_drupal/src/Tests/StubTestTrait.php \Drupal\migrate_drupal\Tests\StubTestTrait::performStubTest()

Tests that creating a stub of an entity type results in a valid entity.

Parameters

string $entity_type_id: The entity type we are stubbing.

File

core/modules/migrate/tests/src/StubTestTrait.php, line 21

Class

StubTestTrait
Provides common functionality for testing stubbing.

Namespace

Drupal\Tests\migrate

Code

protected function performStubTest(string $entity_type_id) : void {
  $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));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.