You are here

public function ContainerTest::test_resolveServicesAndParameters_array in Service Container 7.2

Same name and namespace in other branches
  1. 7 tests/src/DependencyInjection/ContainerTest.php \Drupal\Tests\service_container\DependencyInjection\ContainerTest::test_resolveServicesAndParameters_array()

Tests that services with an array of arguments work correctly. @covers ::get() @covers ::resolveServicesAndParameters()

File

tests/src/DependencyInjection/ContainerTest.php, line 332
Contains \Drupal\Tests\service_container\DependencyInjection\ContainerTest

Class

ContainerTest
@coversDefaultClass \Drupal\service_container\DependencyInjection\Container @group dic

Namespace

Drupal\Tests\service_container\DependencyInjection

Code

public function test_resolveServicesAndParameters_array() {
  $service = $this->container
    ->get('service_using_array');
  $other_service = $this->container
    ->get('other.service');
  $this
    ->assertEquals($other_service, $service
    ->getSomeOtherService(), '@other.service was injected via constructor.');
}