function QueryTest::testNoBaseTable

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php \Drupal\Tests\Core\Entity\Query\Sql\QueryTest::testNoBaseTable()
  2. 10 core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php \Drupal\Tests\Core\Entity\Query\Sql\QueryTest::testNoBaseTable()
  3. 11.x core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php \Drupal\Tests\Core\Entity\Query\Sql\QueryTest::testNoBaseTable()

Tests entity query for entity type without base table.

@covers ::prepare

File

core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php, line 41

Class

QueryTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21Query%21Sql%21Query.php/class/Query/8.9.x" title="The SQL storage entity query class." class="local">\Drupal\Core\Entity\Query\Sql\Query</a> @group Entity

Namespace

Drupal\Tests\Core\Entity\Query\Sql

Code

public function testNoBaseTable() {
    $this->expectException(QueryException::class);
    $this->expectExceptionMessage('No base table for example_entity_query, invalid query.');
    $this->query
        ->execute();
}

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