More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / tests / Drupal / Tests / Component / DependencyInjection / PhpArrayContainerTest.php
1 <?php
2
3 namespace Drupal\Tests\Component\DependencyInjection;
4
5 use Symfony\Component\DependencyInjection\ContainerInterface;
6
7 /**
8  * @coversDefaultClass \Drupal\Component\DependencyInjection\PhpArrayContainer
9  * @group DependencyInjection
10  */
11 class PhpArrayContainerTest extends ContainerTest {
12
13   /**
14    * {@inheritdoc}
15    */
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);
21   }
22
23   /**
24    * Helper function to return a service definition.
25    */
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);
29     }
30
31     return sprintf('@%s', $id);
32   }
33
34   /**
35    * Helper function to return a service definition.
36    */
37   protected function getParameterCall($name) {
38     return '%' . $name . '%';
39   }
40
41   /**
42    * Helper function to return a machine-optimized '@notation'.
43    */
44   protected function getCollection($collection, $resolve = TRUE) {
45     return $collection;
46   }
47
48 }