You are here

public function NodeRevisionGenerateTest::providerGetAvailableNodesForRevisions in Node Revision Delete 8

Data provider for testGetAvailableNodesForRevisions().

Return value

array An array of arrays, each containing:

  • 'expected' - Expected return from ::getAvailableNodesForRevisions().
  • 'bundles' - The content types to generate node revisions.
  • 'revisions_age' - Time to add to the last revision date of the node.

See also

testGetAvailableNodesForRevisions()

File

modules/node_revision_generate/tests/src/Unit/NodeRevisionGenerateTest.php, line 243

Class

NodeRevisionGenerateTest
Tests the NodeRevisionGenerate class methods.

Namespace

Drupal\Tests\node_revision_generate\Unit

Code

public function providerGetAvailableNodesForRevisions() {

  // Set for the bundles.
  $bundles = [];
  $bundles[0] = [
    'page',
    'blog',
    'article',
  ];
  $bundles[1] = [
    'house',
    'car',
  ];
  $bundles[2] = [
    'person',
    'dog',
    'cat',
    'bird',
  ];

  // Set for the revisions age option.
  $revisions_age = $this
    ->getRevisionAge();

  // Getting the expected revisions.
  $expected = $this
    ->getRevisions();
  $tests = [];
  $tests['t1'] = [
    $expected[0],
    $bundles[0],
    $revisions_age[0],
  ];
  $tests['t2'] = [
    $expected[1],
    $bundles[1],
    $revisions_age[1],
  ];
  $tests['t3'] = [
    $expected[2],
    $bundles[2],
    $revisions_age[2],
  ];
  $tests['t4'] = [
    $expected[3],
    $bundles[1],
    $revisions_age[3],
  ];
  $tests['t5'] = [
    $expected[4],
    $bundles[0],
    $revisions_age[4],
  ];
  return $tests;
}