function DatabaseLegacyTest::testDbOptionsTargetInSelect

Tests deprecation of the $options 'target' key in Select.

@expectedDeprecation Passing a 'target' key to \Drupal\Core\Database\Connection::query $options argument is deprecated in drupal:8.0.x and will be removed before drupal:9.0.0. Instead, use \Drupal\Core\Database\Database::getConnection($target)->query(). See https://www.drupal.org/node/2993033

File

core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php, line 460

Class

DatabaseLegacyTest
Deprecation tests cases for the database layer.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testDbOptionsTargetInSelect() {
    $this->assertNotNull($this->connection
        ->select('test', 't', [
        'target' => 'bar',
    ])
        ->fields('t')
        ->execute());
}

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