X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate_drupal%2Ftests%2Fsrc%2FUnit%2Fsource%2FDrupalSqlBaseTest.php;fp=web%2Fcore%2Fmodules%2Fmigrate_drupal%2Ftests%2Fsrc%2FUnit%2Fsource%2FDrupalSqlBaseTest.php;h=fdaf4b10af7ca99ea67c8be49abcb425e5725108;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=ebd9334a2d4fe1feb062da020b7a3750246ff258;hpb=9424afc6c1f518c301bf87a23c047d1873435d05;p=yaffs-website diff --git a/web/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php b/web/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php index ebd9334a2..fdaf4b10a 100644 --- a/web/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php +++ b/web/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php @@ -63,6 +63,22 @@ class DrupalSqlBaseTest extends MigrateTestCase { } } + /** + * @covers ::checkRequirements + */ + public function testSourceDatabaseError() { + $plugin_definition['requirements_met'] = TRUE; + $plugin_definition['source_module'] = 'module1'; + /** @var \Drupal\Core\State\StateInterface $state */ + $state = $this->getMock('Drupal\Core\State\StateInterface'); + /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */ + $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); + $plugin = new TestDrupalSqlBase([], 'test', $plugin_definition, $this->getMigration(), $state, $entity_manager); + $system_data = $plugin->getSystemData(); + $this->setExpectedException(RequirementsException::class, 'No database connection configured for source plugin test'); + $plugin->checkRequirements(); + } + } namespace Drupal\Tests\migrate_drupal\Unit\source;