function DrupalSqlBaseTest::testSourceDatabaseError
@covers ::checkRequirements
      
    
File
- 
              core/
modules/ migrate_drupal/ tests/ src/ Unit/ source/ DrupalSqlBaseTest.php, line 70  
Class
- DrupalSqlBaseTest
 - @coversDefaultClass Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase[[api-linebreak]] @group migrate_drupal
 
Namespace
Drupal\Tests\migrate_drupal\Unit\sourceCode
public function testSourceDatabaseError() {
  $plugin_definition['requirements_met'] = TRUE;
  $plugin_definition['source_module'] = 'module1';
  /** @var \Drupal\Core\State\StateInterface $state */
  $state = $this->createMock('Drupal\\Core\\State\\StateInterface');
  /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager */
  $entity_manager = $this->createMock('Drupal\\Core\\Entity\\EntityTypeManagerInterface');
  $plugin = new TestDrupalSqlBase([], 'test', $plugin_definition, $this->getMigration(), $state, $entity_manager);
  $system_data = $plugin->getSystemData();
  $this->expectException(RequirementsException::class);
  $this->expectExceptionMessage('No database connection configured for source plugin test');
  $plugin->checkRequirements();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.