Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ServiceLocatorTestCase.php

function ServiceLocatorTestCase::testGet

File

vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php, line 42

Class

ServiceLocatorTestCase

Namespace

Symfony\Contracts\Service\Test

Code

public function testGet() {
    $locator = $this->getServiceLocator([
        'foo' => fn() => 'bar',
        'bar' => fn() => 'baz',
    ]);
    $this->assertSame('bar', $locator->get('foo'));
    $this->assertSame('baz', $locator->get('bar'));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal