You are here

public function MathTest::testSequential in Realistic Dummy Content 7.2

Same name and namespace in other branches
  1. 8.2 api/src/test/includes/MathTest.php \Drupal\realistic_dummy_content_api\Test\MathTest::testSequential()

Tests Math::sequential().

@dataProvider providerTestSequential

Parameters

int $start: Start number passed to realistic_dummy_content_api_sequential().

int $end: End number passed to realistic_dummy_content_api_sequential().

string $hash: Hash passed to realistic_dummy_content_api_sequential().

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

File

api/src/test/includes/MathTest.php, line 31

Class

MathTest
Tests for \Drupal\realistic_dummy_content_api\includes\Math.

Namespace

Drupal\realistic_dummy_content_api\Test

Code

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