PhpArrayContainerTest.php in Drupal 8
File
core/tests/Drupal/Tests/Component/DependencyInjection/PhpArrayContainerTest.php
View source
<?php
namespace Drupal\Tests\Component\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerInterface;
class PhpArrayContainerTest extends ContainerTest {
protected function setUp() {
$this->machineFormat = FALSE;
$this->containerClass = '\\Drupal\\Component\\DependencyInjection\\PhpArrayContainer';
$this->containerDefinition = $this
->getMockContainerDefinition();
$this->container = new $this->containerClass($this->containerDefinition);
}
protected function getServiceCall($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
if ($invalid_behavior !== ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
return sprintf('@?%s', $id);
}
return sprintf('@%s', $id);
}
protected function getParameterCall($name) {
return '%' . $name . '%';
}
protected function getCollection($collection, $resolve = TRUE) {
return $collection;
}
}