You are here

public function NodeRevisionGenerateTest::testGetRevisionCreationBatch in Node Revision Delete 8

Tests the getRevisionCreationBatch() method.

@covers ::getRevisionCreationBatch @dataProvider providerGetRevisionCreationBatch

Parameters

array $expected: The expected result from calling the function.

array $nodes_for_revisions: The nodes for revisions array.

int $revisions_number: Number of revisions to generate.

int $revisions_age: Interval in Unix timestamp format to add to the last revision date of the node.

File

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

Class

NodeRevisionGenerateTest
Tests the NodeRevisionGenerate class methods.

Namespace

Drupal\Tests\node_revision_generate\Unit

Code

public function testGetRevisionCreationBatch(array $expected, array $nodes_for_revisions, $revisions_number, $revisions_age) {

  // Mocking getRequestTime method.
  $this->time
    ->expects($this
    ->any())
    ->method('getRequestTime')
    ->willReturn($this
    ->getRequestTime());

  // Testing the method.
  $this
    ->assertEquals($expected, $this->nodeRevisionGenerate
    ->getRevisionCreationBatch($nodes_for_revisions, $revisions_number, $revisions_age));
}