You are here

class MockInstantiationService in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\MockInstantiationService
  2. 10 core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\MockInstantiationService

Helper class to test Container::get() method for varying number of parameters.

@group DependencyInjection

Hierarchy

Expanded class hierarchy of MockInstantiationService

File

core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php, line 1041
Contains \Drupal\Tests\Component\DependencyInjection\ContainerTest.

Namespace

Drupal\Tests\Component\DependencyInjection
View source
class MockInstantiationService {

  /**
   * @var mixed[]
   */
  protected $arguments;

  /**
   * Construct a mock instantiation service.
   */
  public function __construct() {
    $this->arguments = func_get_args();
  }

  /**
   * Return arguments injected into the service.
   *
   * @return mixed[]
   *   Return the passed arguments.
   */
  public function getArguments() {
    return $this->arguments;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MockInstantiationService::$arguments protected property
MockInstantiationService::getArguments public function Return arguments injected into the service.
MockInstantiationService::__construct public function Construct a mock instantiation service.