class TestDrupalSqlBase

Same name and namespace in other branches
  1. 10 core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php \Drupal\Tests\migrate_drupal\Unit\source\TestDrupalSqlBase
  2. 11.x core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php \Drupal\Tests\migrate_drupal\Unit\source\TestDrupalSqlBase
  3. 8.9.x core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php \Drupal\Tests\migrate_drupal\Unit\source\TestDrupalSqlBase

Extends the DrupalSqlBase abstract class.

Hierarchy

Expanded class hierarchy of TestDrupalSqlBase

File

core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php, line 174

Namespace

Drupal\Tests\migrate_drupal\Unit\source
View source
class TestDrupalSqlBase extends DrupalSqlBase {
  
  /**
   * {@inheritdoc}
   */
  public function fields() {
    return [];
  }
  
  /**
   * {@inheritdoc}
   */
  public function query() {
    throw new \RuntimeException(__METHOD__ . " not implemented for " . __CLASS__);
  }
  
  /**
   * Tweaks DrupalSqlBase to set a new database connection for tests.
   *
   * @param \Drupal\Core\Database\Connection $database
   *   The new connection to use.
   *
   * @see \Drupal\Tests\migrate\Unit\MigrateSourceSqlTestCase
   */
  public function setDatabase(Connection $database) {
    $this->database = $database;
  }
  
  /**
   * {@inheritdoc}
   */
  public function getIds() {
    return [];
  }

}

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