function ConnectionTest::testStatementPrefetchDeprecation

Tests deprecation of the StatementPrefetch class.

@group legacy

File

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

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function testStatementPrefetchDeprecation() : void {
    $this->expectDeprecation('\\Drupal\\Core\\Database\\StatementPrefetch is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \\Drupal\\Core\\Database\\StatementPrefetchIterator instead. See https://www.drupal.org/node/3265938');
    $mockPdo = $this->createMock(StubPDO::class);
    $mockConnection = new StubConnection($mockPdo, []);
    $statement = new StatementPrefetch($mockPdo, $mockConnection, '');
    $this->assertInstanceOf(StatementPrefetch::class, $statement);
}

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