function ContrivedControllerTest::providerTestHandCountIsolated

Same name in other branches
  1. 3.x modules/testing_example/tests/src/Unit/Controller/ContrivedControllerTest.php \Drupal\Tests\testing_example\Unit\Controller\ContrivedControllerTest::providerTestHandCountIsolated()
  2. 4.0.x modules/testing_example/tests/src/Unit/Controller/ContrivedControllerTest.php \Drupal\Tests\testing_example\Unit\Controller\ContrivedControllerTest::providerTestHandCountIsolated()

Data provider for testHandCountIsolated().

File

testing_example/tests/src/Unit/Controller/ContrivedControllerTest.php, line 75

Class

ContrivedControllerTest
The class to test ContrivedController.

Namespace

Drupal\Tests\testing_example\Unit\Controller

Code

public function providerTestHandCountIsolated() {
    $data = [];
    // Add one-hand data.
    foreach (range(0, 5) as $sum) {
        $data[] = [
            'I can count these on one hand.',
            $sum,
        ];
    }
    // Add two-hand data.
    foreach (range(6, 10) as $sum) {
        $data[] = [
            'I need two hands to count these.',
            $sum,
        ];
    }
    // Add too-many data.
    foreach (range(11, 15) as $sum) {
        $data[] = [
            'That\'s just too many numbers to count.',
            $sum,
        ];
    }
    return $data;
}