Mercurial > hg > isophonics-drupal-site
annotate core/tests/Drupal/Tests/Component/DependencyInjection/PhpArrayContainerTest.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Tests\Component\DependencyInjection; |
Chris@0 | 4 |
Chris@0 | 5 use Symfony\Component\DependencyInjection\ContainerInterface; |
Chris@0 | 6 |
Chris@0 | 7 /** |
Chris@0 | 8 * @coversDefaultClass \Drupal\Component\DependencyInjection\PhpArrayContainer |
Chris@0 | 9 * @group DependencyInjection |
Chris@0 | 10 */ |
Chris@0 | 11 class PhpArrayContainerTest extends ContainerTest { |
Chris@0 | 12 |
Chris@0 | 13 /** |
Chris@0 | 14 * {@inheritdoc} |
Chris@0 | 15 */ |
Chris@0 | 16 protected function setUp() { |
Chris@0 | 17 $this->machineFormat = FALSE; |
Chris@0 | 18 $this->containerClass = '\Drupal\Component\DependencyInjection\PhpArrayContainer'; |
Chris@0 | 19 $this->containerDefinition = $this->getMockContainerDefinition(); |
Chris@0 | 20 $this->container = new $this->containerClass($this->containerDefinition); |
Chris@0 | 21 } |
Chris@0 | 22 |
Chris@0 | 23 /** |
Chris@0 | 24 * Helper function to return a service definition. |
Chris@0 | 25 */ |
Chris@0 | 26 protected function getServiceCall($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) { |
Chris@0 | 27 if ($invalid_behavior !== ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) { |
Chris@0 | 28 return sprintf('@?%s', $id); |
Chris@0 | 29 } |
Chris@0 | 30 |
Chris@0 | 31 return sprintf('@%s', $id); |
Chris@0 | 32 } |
Chris@0 | 33 |
Chris@0 | 34 /** |
Chris@0 | 35 * Helper function to return a service definition. |
Chris@0 | 36 */ |
Chris@0 | 37 protected function getParameterCall($name) { |
Chris@0 | 38 return '%' . $name . '%'; |
Chris@0 | 39 } |
Chris@0 | 40 |
Chris@0 | 41 /** |
Chris@0 | 42 * Helper function to return a machine-optimized '@notation'. |
Chris@0 | 43 */ |
Chris@0 | 44 protected function getCollection($collection, $resolve = TRUE) { |
Chris@0 | 45 return $collection; |
Chris@0 | 46 } |
Chris@0 | 47 |
Chris@0 | 48 } |