You are here

public function NodeRevisionDeleteTest::providerGetTimeValues in Node Revision Delete 8

Data provider for testGetTimeNumberString().

Return value

array An array of arrays, each containing:

  • 'expected' - Expected return from getTimeValues().
  • 'index' - The number.

See also

testGetTimeValues()

File

tests/src/Unit/NodeRevisionDeleteTest.php, line 212

Class

NodeRevisionDeleteTest
Tests the NodeRevisionDelete class methods.

Namespace

Drupal\Tests\node_revision_delete\Unit

Code

public function providerGetTimeValues() {
  $all_values = [
    '-1' => 'Never',
    '0' => 'Every time cron runs',
    '3600' => 'Every hour',
    '86400' => 'Everyday',
    '604800' => 'Every week',
    '864000' => 'Every 10 days',
    '1296000' => 'Every 15 days',
    '2592000' => 'Every month',
    '7776000' => 'Every 3 months',
    '15552000' => 'Every 6 months',
    '31536000' => 'Every year',
    '63072000' => 'Every 2 years',
  ];
  $tests[] = [
    $all_values,
    NULL,
  ];
  $tests[] = [
    $all_values[-1],
    -1,
  ];
  $tests[] = [
    $all_values[0],
    0,
  ];
  $tests[] = [
    $all_values[3600],
    3600,
  ];
  $tests[] = [
    $all_values[86400],
    86400,
  ];
  $tests[] = [
    $all_values[604800],
    604800,
  ];
  $tests[] = [
    $all_values[864000],
    864000,
  ];
  $tests[] = [
    $all_values[1296000],
    1296000,
  ];
  $tests[] = [
    $all_values[2592000],
    2592000,
  ];
  $tests[] = [
    $all_values[7776000],
    7776000,
  ];
  $tests[] = [
    $all_values[15552000],
    15552000,
  ];
  $tests[] = [
    $all_values[31536000],
    31536000,
  ];
  $tests[] = [
    $all_values[63072000],
    63072000,
  ];
  return $tests;
}