class MockContainerInjection

Same name in this branch
  1. 10 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\MockContainerInjection
Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\MockContainerInjection
  2. 8.9.x core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\MockContainerInjection
  3. 11.x core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\MockContainerInjection
  4. 11.x core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php \Drupal\Tests\Core\Utility\MockContainerInjection

Hierarchy

Expanded class hierarchy of MockContainerInjection

File

core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php, line 221

Namespace

Drupal\Tests\Core\Utility
View source
class MockContainerInjection implements ContainerInjectionInterface {
    protected $injected;
    public function __construct($result) {
        $this->injected = $result;
    }
    public static function create(ContainerInterface $container) {
        return new static('foo');
    }
    public function getResult($suffix) {
        return __METHOD__ . '-' . $this->injected . '+' . $suffix;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
MockContainerInjection::$injected protected property
MockContainerInjection::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create
MockContainerInjection::getResult public function
MockContainerInjection::__construct public function

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