You are here

class MockContainerInjection in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\MockContainerInjection
  2. 9 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\MockContainerInjection

Hierarchy

Expanded class hierarchy of MockContainerInjection

File

core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php, line 219
Contains \Drupal\Tests\Core\Controller\ControllerResolverTest.

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

Namesort descending Modifiers Type Description Overrides
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