function MockContainerAware::getResult

Same name in this branch
  1. 10 core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php \Drupal\Tests\Core\Utility\MockContainerAware::getResult()
Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\MockContainerAware::getResult()
  2. 8.9.x core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\MockContainerAware::getResult()

File

core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php, line 249

Class

MockContainerAware

Namespace

Drupal\Tests\Core\Controller

Code

public function getResult() {
    if (empty($this->container)) {
        throw new \Exception('Container was not injected.');
    }
    return 'This is container aware.';
}

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