You are here

public function NodeRevisionDeleteTest::providerGetTimeNumberString in Node Revision Delete 8

Data provider for testGetTimeNumberString().

Return value

array An array of arrays, each containing:

  • 'expected' - Expected return from getTimeNumberString().
  • 'number' - The number.
  • 'time' - The time option (days, weeks or months).

See also

testGetTimeNumberString()

File

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

Class

NodeRevisionDeleteTest
Tests the NodeRevisionDelete class methods.

Namespace

Drupal\Tests\node_revision_delete\Unit

Code

public function providerGetTimeNumberString() {

  // Days.
  $tests['day singular'] = [
    'day',
    1,
    'days',
  ];
  $tests['day plural 1'] = [
    'days',
    2,
    'days',
  ];
  $tests['day plural 2'] = [
    'days',
    10,
    'days',
  ];

  // Weeks.
  $tests['week singular'] = [
    'week',
    1,
    'weeks',
  ];
  $tests['week plural 1'] = [
    'weeks',
    2,
    'weeks',
  ];
  $tests['week plural 2'] = [
    'weeks',
    10,
    'weeks',
  ];

  // Months.
  $tests['month singular'] = [
    'month',
    1,
    'months',
  ];
  $tests['month plural 1'] = [
    'months',
    2,
    'months',
  ];
  $tests['month plural 2'] = [
    'months',
    10,
    'months',
  ];
  return $tests;
}