You are here

class PhpArrayDumperTest in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php \Drupal\Tests\Component\DependencyInjection\Dumper\PhpArrayDumperTest

@coversDefaultClass \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper @group DependencyInjection

Hierarchy

Expanded class hierarchy of PhpArrayDumperTest

File

core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php, line 11

Namespace

Drupal\Tests\Component\DependencyInjection\Dumper
View source
class PhpArrayDumperTest extends OptimizedPhpArrayDumperTest {

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    $this->machineFormat = FALSE;
    $this->dumperClass = '\\Drupal\\Component\\DependencyInjection\\Dumper\\PhpArrayDumper';
    parent::setUp();
  }

  /**
   * {@inheritdoc}
   */
  protected function serializeDefinition(array $service_definition) {
    return $service_definition;
  }

  /**
   * {@inheritdoc}
   */
  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);
  }

  /**
   * {@inheritdoc}
   */
  protected function getParameterCall($name) {
    return '%' . $name . '%';
  }

  /**
   * {@inheritdoc}
   */
  protected function getCollection($collection, $resolve = TRUE) {
    return $collection;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OptimizedPhpArrayDumperTest::$containerBuilder protected property The container builder instance.
OptimizedPhpArrayDumperTest::$containerDefinition protected property The definition for the container to build in tests.
OptimizedPhpArrayDumperTest::$dumper protected property The dumper instance.
OptimizedPhpArrayDumperTest::$dumperClass protected property Stores the dumper class to use.
OptimizedPhpArrayDumperTest::$machineFormat protected property Whether the dumper uses the machine-optimized format or not.
OptimizedPhpArrayDumperTest::getAliasesDataProvider public function Data provider for testGetAliases().
OptimizedPhpArrayDumperTest::getDefinitionsDataProvider public function Data provider for testGetServiceDefinitions().
OptimizedPhpArrayDumperTest::getParametersDataProvider public function Data provider for testGetParameters().
OptimizedPhpArrayDumperTest::getPrivateServiceCall protected function Helper function to return a private service definition.
OptimizedPhpArrayDumperTest::getRaw protected function Helper function to return a raw value definition.
OptimizedPhpArrayDumperTest::percentsEscapeProvider public function Data provider for testPercentsEscape().
OptimizedPhpArrayDumperTest::publicPrivateDataProvider public function
OptimizedPhpArrayDumperTest::testDumpForEmptyContainer public function Tests that an empty container works properly.
OptimizedPhpArrayDumperTest::testGetAliases public function Tests that alias processing works properly.
OptimizedPhpArrayDumperTest::testGetParameters public function Tests that parameter processing works properly.
OptimizedPhpArrayDumperTest::testGetServiceDefinitionForDecoratedService public function Tests that getDecoratedService() is unsupported.
OptimizedPhpArrayDumperTest::testGetServiceDefinitionForExpression public function Tests that the correct RuntimeException is thrown for expressions.
OptimizedPhpArrayDumperTest::testGetServiceDefinitionForObject public function Tests that the correct RuntimeException is thrown for dumping an object.
OptimizedPhpArrayDumperTest::testGetServiceDefinitionForResource public function Tests that the correct RuntimeException is thrown for dumping a resource.
OptimizedPhpArrayDumperTest::testGetServiceDefinitions public function Tests that service processing works properly.
OptimizedPhpArrayDumperTest::testGetServiceDefinitionWithReferenceToAlias public function Tests that references to aliases work correctly.
OptimizedPhpArrayDumperTest::testPercentsEscape public function Tests that service arguments with escaped percents are correctly dumped.
PhpArrayDumperTest::getCollection protected function Helper function to return a machine-optimized collection. Overrides OptimizedPhpArrayDumperTest::getCollection
PhpArrayDumperTest::getParameterCall protected function Helper function to return a parameter definition. Overrides OptimizedPhpArrayDumperTest::getParameterCall
PhpArrayDumperTest::getServiceCall protected function Helper function to return a service definition. Overrides OptimizedPhpArrayDumperTest::getServiceCall
PhpArrayDumperTest::serializeDefinition protected function Helper function to serialize a definition. Overrides OptimizedPhpArrayDumperTest::serializeDefinition
PhpArrayDumperTest::setUp protected function Overrides OptimizedPhpArrayDumperTest::setUp