public function MigrationTest::testRequirementsForSourcePlugin in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/migrate/tests/src/Unit/MigrationTest.php \Drupal\Tests\migrate\Unit\MigrationTest::testRequirementsForSourcePlugin()
Tests checking requirements for source plugins.
@covers ::checkRequirements
@expectedException \Drupal\migrate\Exception\RequirementsException @expectedExceptionMessage Missing source requirement
File
- core/
modules/ migrate/ tests/ src/ Unit/ MigrationTest.php, line 32 - Contains \Drupal\Tests\migrate\Unit\MigrationTest.
Class
- MigrationTest
- @coversDefaultClass \Drupal\migrate\Entity\Migration @group Migration
Namespace
Drupal\Tests\migrate\UnitCode
public function testRequirementsForSourcePlugin() {
$migration = new TestMigration();
$source_plugin = $this
->getMock('Drupal\\Tests\\migrate\\Unit\\RequirementsAwareSourceInterface');
$source_plugin
->expects($this
->once())
->method('checkRequirements')
->willThrowException(new RequirementsException('Missing source requirement', [
'key' => 'value',
]));
$destination_plugin = $this
->getMock('Drupal\\Tests\\migrate\\Unit\\RequirementsAwareDestinationInterface');
$migration
->setSourcePlugin($source_plugin);
$migration
->setDestinationPlugin($destination_plugin);
$migration
->checkRequirements();
}