You are here

public function ContainerTest::testGetServiceIds in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/dependency-injection/Tests/ContainerTest.php \Symfony\Component\DependencyInjection\Tests\ContainerTest::testGetServiceIds()
  2. 8 core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\ContainerTest::testGetServiceIds()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Tests/ContainerTest.php \Symfony\Component\DependencyInjection\Tests\ContainerTest::testGetServiceIds()

@covers Symfony\Component\DependencyInjection\Container::getServiceIds

File

vendor/symfony/dependency-injection/Tests/ContainerTest.php, line 140

Class

ContainerTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testGetServiceIds() {
  $sc = new Container();
  $sc
    ->set('foo', $obj = new \stdClass());
  $sc
    ->set('bar', $obj = new \stdClass());
  $this
    ->assertEquals(array(
    'service_container',
    'foo',
    'bar',
  ), $sc
    ->getServiceIds(), '->getServiceIds() returns all defined service ids');
  $sc = new ProjectServiceContainer();
  $sc
    ->set('foo', $obj = new \stdClass());
  $this
    ->assertEquals(array(
    'scoped',
    'scoped_foo',
    'scoped_synchronized_foo',
    'inactive',
    'bar',
    'foo_bar',
    'foo.baz',
    'circular',
    'throw_exception',
    'throws_exception_on_service_configuration',
    'service_container',
    'foo',
  ), $sc
    ->getServiceIds(), '->getServiceIds() returns defined service ids by getXXXService() methods, followed by service ids defined by set()');
}