You are here

function RealisticDummyContentTest::assertSequential in Realistic Dummy Content 8

Helper function to assert that the sequential number generator works.

This calls realistic_dummy_content_api_sequential(), making sure that the result is as expected.

Parameters

$start: Start number passed to realistic_dummy_content_api_sequential()

$end: End number passed to realistic_dummy_content_api_sequential()

$hash: Hash passed to realistic_dummy_content_api_sequential()

$expected: Expected result which realistic_dummy_content_api_sequential() is expected to return.

1 call to RealisticDummyContentTest::assertSequential()
RealisticDummyContentTest::testSequential in api/tests/src/Unit/facade/RealisticDummyContentTest.php

File

api/tests/src/Unit/facade/RealisticDummyContentTest.php, line 73
Define autoload class.

Class

RealisticDummyContentTest
Test Realistic dummy content.

Namespace

Drupal\Tests\realistic_dummy_content_api\Unit\facade

Code

function assertSequential($start, $end, $hash, $expected) {
  $result = RealisticDummyContent::sequential($start, $end, $hash);
  $this
    ->assertTrue($result == $expected, 'Sequential number is as expected for ' . $start . ', ' . $end . ' with hash ' . $hash . ': [expected] ' . $expected . ' = [result] ' . $result);
}