function EmptyStatementTest::testEmptyIteration

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Database/EmptyStatementTest.php \Drupal\Tests\Core\Database\EmptyStatementTest::testEmptyIteration()

Tests that the empty result set iterates safely.

File

core/tests/Drupal/Tests/Core/Database/EmptyStatementTest.php, line 32

Class

EmptyStatementTest
Tests the empty pseudo-statement class.

Namespace

Drupal\Tests\Core\Database

Code

public function testEmptyIteration() {
    $result = new StatementEmpty();
    $this->assertSame(0, iterator_count($result), 'Empty result set should not iterate.');
}

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