function ContainerTest::testGetForInstantiationWithVariousArgumentLengths

Tests that Container::get() for various arguments lengths works.

@legacy-covers ::get @legacy-covers ::createService @legacy-covers ::resolveServicesAndParameters

File

core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php, line 455

Class

ContainerTest
Tests Drupal\Component\DependencyInjection\Container.

Namespace

Drupal\Tests\Component\DependencyInjection

Code

public function testGetForInstantiationWithVariousArgumentLengths() : void {
  $args = [];
  for ($i = 0; $i < 12; $i++) {
    $instantiation_service = $this->container
      ->get('service_test_instantiation_' . $i);
    $this->assertEquals($args, $instantiation_service->getArguments());
    $args[] = 'arg_' . $i;
  }
}

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