function PathParentCacheContextTest::providerTestGetContext

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php \Drupal\Tests\Core\Cache\Context\PathParentCacheContextTest::providerTestGetContext()
  2. 8.9.x core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php \Drupal\Tests\Core\Cache\Context\PathParentCacheContextTest::providerTestGetContext()
  3. 11.x core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php \Drupal\Tests\Core\Cache\Context\PathParentCacheContextTest::providerTestGetContext()

Provides a list of paths and expected cache contexts.

File

core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php, line 34

Class

PathParentCacheContextTest
@coversDefaultClass \Drupal\Core\Cache\Context\PathParentCacheContext @group Cache

Namespace

Drupal\Tests\Core\Cache\Context

Code

public static function providerTestGetContext() {
    return [
        [
            '/some/path',
            'some',
        ],
        [
            '/some/other-path',
            'some',
        ],
        [
            '/some/other/path',
            'some/other',
        ],
        [
            '/some/other/path?q=foo&b=bar',
            'some/other',
        ],
        [
            '/some',
            '',
        ],
        [
            '/',
            '',
        ],
    ];
}

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