You are here

public function ZfExtensionManagerSfContainerTest::testHas in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Bridge/ZfExtensionManagerSfContainerTest.php \Drupal\Tests\Component\Bridge\ZfExtensionManagerSfContainerTest::testHas()

@covers ::setContainer @covers ::has

File

core/tests/Drupal/Tests/Component/Bridge/ZfExtensionManagerSfContainerTest.php, line 38
Contains \Drupal\Tests\Component\Bridge\ZfExtensionManagerSfContainerTest.

Class

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

Namespace

Drupal\Tests\Component\Bridge

Code

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'));
}