You are here

public function CheckRequirementsTest::testException in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\CheckRequirementsTest::testException()
  2. 10 core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\CheckRequirementsTest::testException()

Tests the check requirements exception message.

File

core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php, line 22

Class

CheckRequirementsTest
Tests check requirements exception on DestinationBase.

Namespace

Drupal\Tests\migrate\Unit\Plugin\migrate\destination

Code

public function testException() {
  $destination = new Config([
    'config_name' => 'test',
  ], 'test', [], $this
    ->prophesize(MigrationInterface::class)
    ->reveal(), $this
    ->prophesize(ConfigFactoryInterface::class)
    ->reveal(), $this
    ->prophesize(LanguageManagerInterface::class)
    ->reveal());
  $this
    ->expectException(RequirementsException::class);
  $this
    ->expectExceptionMessage("Destination plugin 'test' did not meet the requirements");
  $destination
    ->checkRequirements();
}