PhpArrayDumperTest.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Drupal\Tests\Component\DependencyInjection\Dumper;
  3. use Symfony\Component\DependencyInjection\ContainerInterface;
  4. /**
  5. * @coversDefaultClass \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper
  6. * @group DependencyInjection
  7. */
  8. class PhpArrayDumperTest extends OptimizedPhpArrayDumperTest {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. protected function setUp() {
  13. $this->machineFormat = FALSE;
  14. $this->dumperClass = '\Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper';
  15. parent::setUp();
  16. }
  17. /**
  18. * {@inheritdoc}
  19. */
  20. protected function serializeDefinition(array $service_definition) {
  21. return $service_definition;
  22. }
  23. /**
  24. * {@inheritdoc}
  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. return sprintf('@%s', $id);
  31. }
  32. /**
  33. * {@inheritdoc}
  34. */
  35. protected function getParameterCall($name) {
  36. return '%' . $name . '%';
  37. }
  38. /**
  39. * {@inheritdoc}
  40. */
  41. protected function getCollection($collection, $resolve = TRUE) {
  42. return $collection;
  43. }
  44. }