public function ZfExtensionManagerSfContainerTest::testHas in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Component/Bridge/ZfExtensionManagerSfContainerTest.php \Drupal\Tests\Component\Bridge\ZfExtensionManagerSfContainerTest::testHas()
@covers ::setContainer @covers ::setStandalone @covers ::has
File
- core/
tests/ Drupal/ Tests/ Component/ Bridge/ ZfExtensionManagerSfContainerTest.php, line 43
Class
- ZfExtensionManagerSfContainerTest
- @coversDefaultClass \Drupal\Component\Bridge\ZfExtensionManagerSfContainer @group Bridge
Namespace
Drupal\Tests\Component\BridgeCode
public function testHas() {
$service = new \stdClass();
$service->value = 'myvalue';
$container = new ContainerBuilder();
$container
->set('foo', $service);
$bridge = new ZfExtensionManagerSfContainer();
$bridge
->setContainer($container);
$this
->assertTrue($bridge
->has('foo'));
$this
->assertFalse($bridge
->has('bar'));
$this
->assertFalse($bridge
->has('Atom\\Entry'));
$bridge
->setStandalone(StandaloneExtensionManager::class);
$this
->assertTrue($bridge
->has('Atom\\Entry'));
}