public function ContainerTest::testGetServiceIds

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

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php, line 93

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();
  $this
    ->assertEquals(array(
    'scoped',
    'scoped_foo',
    'bar',
    'foo_bar',
    'foo.baz',
    'circular',
    'throw_exception',
    'service_container',
  ), $sc
    ->getServiceIds(), '->getServiceIds() returns defined service ids by getXXXService() methods');
}