3 namespace Drupal\Tests\Component\DependencyInjection;
5 use Symfony\Component\DependencyInjection\ContainerInterface;
8 * @coversDefaultClass \Drupal\Component\DependencyInjection\PhpArrayContainer
9 * @group DependencyInjection
11 class PhpArrayContainerTest extends ContainerTest {
16 protected function setUp() {
17 $this->machineFormat = FALSE;
18 $this->containerClass = '\Drupal\Component\DependencyInjection\PhpArrayContainer';
19 $this->containerDefinition = $this->getMockContainerDefinition();
20 $this->container = new $this->containerClass($this->containerDefinition);
24 * Helper function to return a service definition.
26 protected function getServiceCall($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
27 if ($invalid_behavior !== ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
28 return sprintf('@?%s', $id);
31 return sprintf('@%s', $id);
35 * Helper function to return a service definition.
37 protected function getParameterCall($name) {
38 return '%' . $name . '%';
42 * Helper function to return a machine-optimized '@notation'.
44 protected function getCollection($collection, $resolve = TRUE) {