You are here

public function ContrivedControllerTest::providerTestHandCountIsolated in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 testing_example/tests/src/Unit/Controller/ContrivedControllerTest.php \Drupal\Tests\testing_example\Unit\Controller\ContrivedControllerTest::providerTestHandCountIsolated()

Data provider for testHandCountIsolated().

File

modules/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;
}