function ConnectionTest::testStatementDeprecation

Tests deprecation of the Statement class.

@group legacy

File

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

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function testStatementDeprecation() {
    if (PHP_VERSION_ID >= 80000) {
        $this->markTestSkipped('Drupal\\Core\\Database\\Statement is incompatible with PHP 8.0. Remove in https://www.drupal.org/node/3177490');
    }
    $this->expectDeprecation('\\Drupal\\Core\\Database\\Statement is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should use or extend StatementWrapper instead, and encapsulate client-level statement objects. See https://www.drupal.org/node/3177488');
    $mock_statement = $this->getMockBuilder(Statement::class)
        ->disableOriginalConstructor()
        ->getMock();
}

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