function ConnectionTest::testStatementWrapperDeprecation

Tests deprecation of the StatementWrapper class.

@group legacy

File

core/tests/Drupal/Tests/Core/Database/ConnectionTest.php, line 891

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function testStatementWrapperDeprecation() : void {
    $this->expectDeprecation('\\Drupal\\Core\\Database\\StatementWrapper is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \\Drupal\\Core\\Database\\StatementWrapperIterator instead. See https://www.drupal.org/node/3265938');
    $mock_pdo = $this->createMock(StubPDO::class);
    $connection = new StubConnection($mock_pdo, []);
    $this->expectError();
    $connection->prepareStatement('boing', []);
}

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