function NumberItemTest::dataNumberFieldSettingsProvider
Same name in other branches
- 9 core/modules/field/tests/src/Kernel/Number/NumberItemTest.php \Drupal\Tests\field\Kernel\Number\NumberItemTest::dataNumberFieldSettingsProvider()
- 8.9.x core/modules/field/tests/src/Kernel/Number/NumberItemTest.php \Drupal\Tests\field\Kernel\Number\NumberItemTest::dataNumberFieldSettingsProvider()
- 10 core/modules/field/tests/src/Kernel/Number/NumberItemTest.php \Drupal\Tests\field\Kernel\Number\NumberItemTest::dataNumberFieldSettingsProvider()
Data provider for testConstraints.
Return value
\Generator The test data.
File
-
core/
modules/ field/ tests/ src/ Kernel/ Number/ NumberItemTest.php, line 170
Class
- NumberItemTest
- Tests the new entity API for the number field type.
Namespace
Drupal\Tests\field\Kernel\NumberCode
public static function dataNumberFieldSettingsProvider() {
(yield [
'integer',
NULL,
NULL,
-100,
FALSE,
]);
(yield [
'integer',
0,
NULL,
-100,
TRUE,
'field_integer: the value may be no less than 0.',
]);
(yield [
'integer',
10,
NULL,
100,
FALSE,
]);
(yield [
'integer',
10,
NULL,
5,
TRUE,
'field_integer: the value may be no less than 10.',
]);
(yield [
'integer',
10,
20,
25,
TRUE,
'field_integer: the value may be no greater than 20.',
]);
(yield [
'integer',
10,
20,
15,
FALSE,
]);
(yield [
'float',
NULL,
NULL,
-100,
FALSE,
]);
(yield [
'float',
0.003,
NULL,
0.0029,
TRUE,
'field_float: the value may be no less than 0.003.',
]);
(yield [
'float',
10.05,
NULL,
13.4,
FALSE,
]);
(yield [
'float',
10,
NULL,
9.999000000000001,
TRUE,
'field_float: the value may be no less than 10.',
]);
(yield [
'float',
1,
2,
2.5,
TRUE,
'field_float: the value may be no greater than 2.',
]);
(yield [
'float',
1,
2,
1.5,
FALSE,
]);
(yield [
'decimal',
NULL,
NULL,
-100,
FALSE,
]);
(yield [
'decimal',
0.001,
NULL,
-0.05,
TRUE,
'field_decimal: the value may be no less than 0.001.',
]);
(yield [
'decimal',
10.05,
NULL,
13.4,
FALSE,
]);
(yield [
'decimal',
10,
NULL,
9.999000000000001,
TRUE,
'field_decimal: the value may be no less than 10.',
]);
(yield [
'decimal',
1,
2,
2.5,
TRUE,
'field_decimal: the value may be no greater than 2.',
]);
(yield [
'decimal',
1,
2,
1.5,
FALSE,
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.