You are here

public function EntityQueryTest::testAccessCheckSpecified in Drupal 9

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php \Drupal\KernelTests\Core\Entity\EntityQueryTest::testAccessCheckSpecified()

Test the accessCheck method is called.

@group legacy

File

core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php, line 1356

Class

EntityQueryTest
Tests Entity Query functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

public function testAccessCheckSpecified() {
  $this
    ->expectDeprecation('Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \\Drupal\\Core\\Entity\\Query\\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked. See https://www.drupal.org/node/3201242');
  $this->storage
    ->getQuery()
    ->execute();
}