PhpArrayDumperTest.php

Same filename and directory in other branches
  1. 9 core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php
  2. 8.9.x core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php
  3. 10 core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php

Namespace

Drupal\Tests\Component\DependencyInjection\Dumper

File

core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\Component\DependencyInjection\Dumper;

use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * @coversDefaultClass \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper
 * @group DependencyInjection
 */
class PhpArrayDumperTest extends OptimizedPhpArrayDumperTest {
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        $this->machineFormat = FALSE;
        $this->dumperClass = '\\Drupal\\Component\\DependencyInjection\\Dumper\\PhpArrayDumper';
        parent::setUp();
    }
    
    /**
     * {@inheritdoc}
     */
    protected static function serializeDefinition(array $service_definition) {
        return $service_definition;
    }
    
    /**
     * {@inheritdoc}
     */
    protected static 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);
    }
    
    /**
     * {@inheritdoc}
     */
    protected static function getParameterCall($name) {
        return '%' . $name . '%';
    }
    
    /**
     * {@inheritdoc}
     */
    protected static function getCollection($collection, $resolve = TRUE) {
        return $collection;
    }

}

Classes

Title Deprecated Summary
PhpArrayDumperTest @coversDefaultClass \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper @group DependencyInjection

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.