function MockService::__construct

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\MockService::__construct()
  2. 10 core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\MockService::__construct()
  3. 11.x core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\MockService::__construct()

Constructs a MockService object.

Parameters

object $some_other_service: (optional) Another injected service.

string $some_parameter: (optional) An injected parameter.

File

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

Class

MockService
Helper class to test Container::get() method.

Namespace

Drupal\Tests\Component\DependencyInjection

Code

public function __construct($some_other_service = NULL, $some_parameter = NULL) {
    if (is_array($some_other_service)) {
        $some_other_service = $some_other_service[0];
    }
    $this->someOtherService = $some_other_service;
    $this->someParameter = $some_parameter;
}

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