function ConfigEntityQueryTest::testCaseSensitivity

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php \Drupal\KernelTests\Core\Entity\ConfigEntityQueryTest::testCaseSensitivity()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php \Drupal\KernelTests\Core\Entity\ConfigEntityQueryTest::testCaseSensitivity()
  3. 11.x core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php \Drupal\KernelTests\Core\Entity\ConfigEntityQueryTest::testCaseSensitivity()

Tests case sensitivity.

File

core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php, line 656

Class

ConfigEntityQueryTest
Tests Config Entity Query functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

public function testCaseSensitivity() {
    // Filter by label with a known containing case-sensitive word.
    $this->queryResults = $this->entityStorage
        ->getQuery()
        ->condition('label', 'TEST', 'CONTAINS')
        ->execute();
    $this->assertResults([
        '3',
        '4',
        '5',
    ]);
    $this->queryResults = $this->entityStorage
        ->getQuery()
        ->condition('label', 'test', 'CONTAINS')
        ->execute();
    $this->assertResults([
        '3',
        '4',
        '5',
    ]);
}

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