Skip to content
Snippets Groups Projects
Unverified Commit 8512e0e9 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3213644 by Beakerboy, daffie:...

Issue #3213644 by Beakerboy, daffie: StatementWrapperLegacyTest::testClientStatementMethod() should be less specific
parent f5fdfe31
No related branches found
No related tags found
Loading
......@@ -20,7 +20,7 @@ class StatementWrapperLegacyTest extends DatabaseTestBase {
*/
protected function setUp(): void {
parent::setUp();
$this->statement = $this->connection->prepareStatement('SELECT * FROM {test}', []);
$this->statement = $this->connection->prepareStatement('SELECT id FROM {test}', []);
if (!$this->statement instanceof StatementWrapper) {
$this->markTestSkipped('This test only works for drivers implementing Drupal\Core\Database\StatementWrapper.');
}
......@@ -31,8 +31,8 @@ protected function setUp(): void {
*/
public function testQueryString() {
$this->expectDeprecation('StatementWrapper::$queryString should not be accessed in drupal:9.1.0 and will error in drupal:10.0.0. Access the client-level statement object via ::getClientStatement(). See https://www.drupal.org/node/3177488');
$this->assertStringContainsString('SELECT * FROM ', $this->statement->queryString);
$this->assertStringContainsString('SELECT * FROM ', $this->statement->getQueryString());
$this->assertStringContainsString('SELECT id FROM ', $this->statement->queryString);
$this->assertStringContainsString('SELECT id FROM ', $this->statement->getQueryString());
}
/**
......@@ -49,7 +49,7 @@ public function testMissingMethod() {
public function testClientStatementMethod() {
$this->expectDeprecation('StatementWrapper::columnCount should not be called in drupal:9.1.0 and will error in drupal:10.0.0. Access the client-level statement object via ::getClientStatement(). See https://www.drupal.org/node/3177488');
$this->statement->execute();
$this->assertEquals(4, $this->statement->columnCount());
$this->assertEquals(1, $this->statement->columnCount());
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment