public static function NumberTest::providerTestValidStep in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Component/Utility/NumberTest.php \Drupal\Tests\Component\Utility\NumberTest::providerTestValidStep()
Provides data for self::testNumberStep().
See also
\Drupal\Tests\Component\Utility\Number::testValidStep
File
- core/
tests/ Drupal/ Tests/ Component/ Utility/ NumberTest.php, line 67 - Contains \Drupal\Tests\Component\Utility\NumberTest.
Class
- NumberTest
- Tests number manipulation utilities.
Namespace
Drupal\Tests\Component\UtilityCode
public static function providerTestValidStep() {
return array(
// Value and step equal.
array(
10.3,
10.3,
TRUE,
),
// Valid integer steps.
array(
42,
21,
TRUE,
),
array(
42,
3,
TRUE,
),
// Valid float steps.
array(
42,
10.5,
TRUE,
),
array(
1,
1 / 3,
TRUE,
),
array(
-100,
100 / 7,
TRUE,
),
array(
1000,
-10,
TRUE,
),
// Valid and very small float steps.
array(
1000.12345,
1.0E-10,
TRUE,
),
array(
3.9999999999999,
1.0E-13,
TRUE,
),
// Invalid integer steps.
array(
100,
30,
FALSE,
),
array(
-10,
4,
FALSE,
),
// Invalid float steps.
array(
6,
5 / 7,
FALSE,
),
array(
10.3,
10.25,
FALSE,
),
// Step mismatches very close to being valid.
array(
70 + 9.0E-7,
10 + 9.0E-7,
FALSE,
),
array(
1936.5,
3.0E-8,
FALSE,
),
);
}