You are here

public function ControllerResolverTest::providerTestGetControllerFromDefinition in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\ControllerResolverTest::providerTestGetControllerFromDefinition()

Provides test data for testGetControllerFromDefinition().

File

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

Class

ControllerResolverTest
@coversDefaultClass \Drupal\Core\Controller\ControllerResolver @group Controller

Namespace

Drupal\Tests\Core\Controller

Code

public function providerTestGetControllerFromDefinition() {
  return array(
    // Tests a method on an object.
    array(
      array(
        new MockController(),
        'getResult',
      ),
      'This is a regular controller.',
    ),
    // Tests a function.
    array(
      'phpversion',
      phpversion(),
    ),
    // Tests an object using __invoke().
    array(
      new MockInvokeController(),
      'This used __invoke().',
    ),
    // Tests a class using __invoke().
    array(
      'Drupal\\Tests\\Core\\Controller\\MockInvokeController',
      'This used __invoke().',
    ),
  );
}