function ZfExtensionManagerSfContainerTest::testCanonicalizeName

Same name in this branch
  1. 9 core/modules/aggregator/tests/src/Unit/ZfExtensionManagerSfContainerTest.php \Drupal\Tests\aggregator\Unit\ZfExtensionManagerSfContainerTest::testCanonicalizeName()
Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Component/Bridge/ZfExtensionManagerSfContainerTest.php \Drupal\Tests\Component\Bridge\ZfExtensionManagerSfContainerTest::testCanonicalizeName()

@covers ::canonicalizeName @dataProvider canonicalizeNameProvider

File

core/tests/Drupal/Tests/Component/Bridge/ZfExtensionManagerSfContainerTest.php, line 102

Class

ZfExtensionManagerSfContainerTest
@coversDefaultClass \Drupal\Component\Bridge\ZfExtensionManagerSfContainer @group Bridge @group legacy

Namespace

Drupal\Tests\Component\Bridge

Code

public function testCanonicalizeName($name, $canonical_name) {
    $service = new \stdClass();
    $service->value = 'my_value';
    $container = new ContainerBuilder();
    $container->set($canonical_name, $service);
    $bridge = new ZfExtensionManagerSfContainer();
    $bridge->setContainer($container);
    $this->assertTrue($bridge->has($name));
    $this->assertEquals($service, $bridge->get($name));
}

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