function CheckRequirementsTest::testException

Same name 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. 8.9.x core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\CheckRequirementsTest::testException()
  3. 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 25

Class

CheckRequirementsTest
Tests check requirements exception on DestinationBase.

Namespace

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

Code

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

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