class QueryTest
Same name in this branch
- 9 core/modules/views/tests/src/Kernel/Plugin/QueryTest.php \Drupal\Tests\views\Kernel\Plugin\QueryTest
- 9 core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php \Drupal\views_test_data\Plugin\views\query\QueryTest
- 9 core/modules/views_ui/tests/src/Functional/QueryTest.php \Drupal\Tests\views_ui\Functional\QueryTest
- 9 core/tests/Drupal/KernelTests/Core/Database/QueryTest.php \Drupal\KernelTests\Core\Database\QueryTest
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Kernel/Plugin/QueryTest.php \Drupal\Tests\views\Kernel\Plugin\QueryTest
- 11.x core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php \Drupal\views_test_data\Plugin\views\query\QueryTest
- 11.x core/modules/views_ui/tests/src/Functional/QueryTest.php \Drupal\Tests\views_ui\Functional\QueryTest
- 11.x core/tests/Drupal/KernelTests/Core/Database/QueryTest.php \Drupal\KernelTests\Core\Database\QueryTest
- 11.x core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php \Drupal\Tests\Core\Entity\Query\Sql\QueryTest
@coversDefaultClass \Drupal\Core\Entity\Query\Sql\Query
@group Entity
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\Core\Entity\Query\Sql\QueryTest implements \Drupal\Tests\UnitTestCase
Expanded class hierarchy of QueryTest
1 string reference to 'QueryTest'
- QueryTest::calculateDependencies in core/
modules/ views/ tests/ modules/ views_test_data/ src/ Plugin/ views/ query/ QueryTest.php
File
-
core/
tests/ Drupal/ Tests/ Core/ Entity/ Query/ Sql/ QueryTest.php, line 14
Namespace
Drupal\Tests\Core\Entity\Query\SqlView source
class QueryTest extends UnitTestCase {
/**
* The query object.
*
* @var \Drupal\Core\Entity\Query\Sql\Query
*/
protected $query;
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$entity_type = new EntityType([
'id' => 'example_entity_query',
]);
$conjunction = 'AND';
$connection = $this->getMockBuilder('Drupal\\Core\\Database\\Connection')
->disableOriginalConstructor()
->getMock();
$namespaces = [
'Drupal\\Core\\Entity\\Query\\Sql',
];
$this->query = new Query($entity_type, $conjunction, $connection, $namespaces);
}
/**
* Tests entity query for entity type without base table.
*
* @covers ::prepare
*/
public function testNoBaseTable() {
$this->expectException(QueryException::class);
$this->expectExceptionMessage('No base table for example_entity_query, invalid query.');
$this->query
->execute();
}
/**
* Tests revision entity query for entity type without revision table.
*
* @covers ::prepare
*/
public function testNoRevisionTable() {
$this->expectException(QueryException::class);
$this->expectExceptionMessage('No revision table for example_entity_query, invalid query.');
$this->query
->allRevisions()
->execute();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.