public function BlockContentEntityReferenceSelectionTest::testQueriesNotAltered in Drupal 8
Same name and namespace in other branches
- 9 core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php \Drupal\Tests\block_content\Kernel\BlockContentEntityReferenceSelectionTest::testQueriesNotAltered()
- 10 core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php \Drupal\Tests\block_content\Kernel\BlockContentEntityReferenceSelectionTest::testQueriesNotAltered()
Tests to make sure queries without the expected tags are not altered.
Throws
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
File
- core/
modules/ block_content/ tests/ src/ Kernel/ BlockContentEntityReferenceSelectionTest.php, line 122
Class
- BlockContentEntityReferenceSelectionTest
- Tests EntityReference selection handlers don't return non-reusable blocks.
Namespace
Drupal\Tests\block_content\KernelCode
public function testQueriesNotAltered() {
// Ensure that queries without all the tags are not altered.
$query = $this->entityTypeManager
->getStorage('block_content')
->getQuery();
$this
->assertCount(2, $query
->execute());
$query = $this->entityTypeManager
->getStorage('block_content')
->getQuery();
$query
->addTag('block_content_access');
$this
->assertCount(2, $query
->execute());
$query = $this->entityTypeManager
->getStorage('block_content')
->getQuery();
$query
->addTag('entity_query_block_content');
$this
->assertCount(2, $query
->execute());
}