function ConnectionTest::testSupportedFetchModes

Same name in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::testSupportedFetchModes()

Tests supported fetch modes.

@dataProvider providerSupportedFetchModes

File

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

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function testSupportedFetchModes(int $mode) : void {
    $mockPdo = $this->createMock(StubPDO::class);
    $mockConnection = new StubConnection($mockPdo, []);
    $statement = new StatementPrefetchIterator($mockPdo, $mockConnection, '');
    $this->assertInstanceOf(StatementPrefetchIterator::class, $statement);
    $statement->setFetchMode($mode);
}

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