You are here

public function LazyContextRepositoryTest::testGetRuntimeContextsSingle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 41
Contains \Drupal\Tests\Core\Plugin\Context\LazyContextRepositoryTest.

Class

LazyContextRepositoryTest
@coversDefaultClass \Drupal\Core\Plugin\Context\LazyContextRepository @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);
}