class MockContainerInjection

Same name in this branch
  1. 10 core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php \Drupal\Tests\Core\Utility\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/Controller/ControllerResolverTest.php, line 219

Namespace

Drupal\Tests\Core\Controller
View source
class MockContainerInjection implements ContainerInjectionInterface {
    protected $result;
    public function __construct($result) {
        $this->result = $result;
    }
    public static function create(ContainerInterface $container) {
        return new static('This used injection.');
    }
    public function getResult() {
        return $this->result;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
MockContainerInjection::$result 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.