function LazyContextRepositoryTest::testGetRuntimeContextsSingle

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php \Drupal\Tests\Core\Plugin\Context\LazyContextRepositoryTest::testGetRuntimeContextsSingle()
  2. 10 core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php \Drupal\Tests\Core\Plugin\Context\LazyContextRepositoryTest::testGetRuntimeContextsSingle()
  3. 11.x core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php \Drupal\Tests\Core\Plugin\Context\LazyContextRepositoryTest::testGetRuntimeContextsSingle()

@covers ::getRuntimeContexts

File

core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php, line 36

Class

LazyContextRepositoryTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Plugin%21Context%21LazyContextRepository.php/class/LazyContextRepository/9" title="Provides a context repository which uses context provider services." class="local">\Drupal\Core\Plugin\Context\LazyContextRepository</a> @group context

Namespace

Drupal\Tests\Core\Plugin\Context

Code

public function testGetRuntimeContextsSingle() {
    $contexts = $this->setupContextAndProvider('test_provider', [
        'test_context',
    ]);
    $lazy_context_repository = new LazyContextRepository($this->container, [
        'test_provider',
    ]);
    $run_time_contexts = $lazy_context_repository->getRuntimeContexts([
        '@test_provider:test_context',
    ]);
    $this->assertEquals([
        '@test_provider:test_context' => $contexts[0],
    ], $run_time_contexts);
}

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