You are here

public function NumberTest::testValidStepOffset in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Utility/NumberTest.php \Drupal\Tests\Component\Utility\NumberTest::testValidStepOffset()
  2. 9 core/tests/Drupal/Tests/Component/Utility/NumberTest.php \Drupal\Tests\Component\Utility\NumberTest::testValidStepOffset()

Tests Number::validStep() with offset.

@dataProvider providerTestValidStepOffset @covers ::validStep

Parameters

numeric $value: The value argument for Number::validStep().

numeric $step: The step argument for Number::validStep().

numeric $offset: The offset argument for Number::validStep().

bool $expected: Expected return value from Number::validStep().

File

core/tests/Drupal/Tests/Component/Utility/NumberTest.php, line 52

Class

NumberTest
Tests number manipulation utilities.

Namespace

Drupal\Tests\Component\Utility

Code

public function testValidStepOffset($value, $step, $offset, $expected) {
  $return = Number::validStep($value, $step, $offset);
  $this
    ->assertEquals($expected, $return);
}