function LazyContextRepositoryTest::testGetRuntimeContextsSingle

Tests get runtime contexts single.

@legacy-covers ::getRuntimeContexts

File

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

Class

LazyContextRepositoryTest
Tests Drupal\Core\Plugin\Context\LazyContextRepository.

Namespace

Drupal\Tests\Core\Plugin\Context

Code

public function testGetRuntimeContextsSingle() : void {
  $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.