function StatementTest::testGetDeprecatedProperties

Tests accessing deprecated properties.

@group legacy

File

core/tests/Drupal/KernelTests/Core/Database/StatementTest.php, line 51

Class

StatementTest
Tests the Statement classes.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testGetDeprecatedProperties() : void {
    $statement = $this->connection
        ->prepareStatement('SELECT * FROM {test}', []);
    $this->expectDeprecation('%s$dbh should not be accessed in drupal:9.3.0 and will error in drupal:10.0.0. Use $this->connection instead. See https://www.drupal.org/node/3186368');
    $this->assertNotNull($statement->dbh);
    $this->expectDeprecation('%s$allowRowCount should not be accessed in drupal:9.3.0 and will error in drupal:10.0.0. Use $this->rowCountEnabled instead. See https://www.drupal.org/node/3186368');
    $this->assertFalse($statement->allowRowCount);
}

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