class MockInstantiationService

Same name in other branches
  1. 8.9.x 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
  3. 11.x 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 1059

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

Title Sort descending Modifiers Object type Summary
MockInstantiationService::$arguments protected property
MockInstantiationService::getArguments public function Return arguments injected into the service.
MockInstantiationService::__construct public function Construct a mock instantiation service.

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