public function TestBaseTest::providerEqualityAssertions in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/simpletest/tests/src/Unit/TestBaseTest.php \Drupal\Tests\simpletest\Unit\TestBaseTest::providerEqualityAssertions()
Data provider for tests of equality assertions.
Used by testAssertIdentical(), testAssertEqual(), testAssertNotIdentical(), and testAssertNotEqual().
Return value
Array of test data.
- Expected assertion value for identical comparison.
- Expected assertion value for equal comparison.
- First value to compare.
- Second value to compare.
File
- core/
modules/ simpletest/ tests/ src/ Unit/ TestBaseTest.php, line 295 - Contains \Drupal\Tests\simpletest\Unit\TestBaseTest.
Class
- TestBaseTest
- @coversDefaultClass \Drupal\simpletest\TestBase @group simpletest
Namespace
Drupal\Tests\simpletest\UnitCode
public function providerEqualityAssertions() {
return [
// Integers and floats.
[
TRUE,
TRUE,
0,
0,
],
[
FALSE,
TRUE,
0,
0.0,
],
[
FALSE,
TRUE,
'0',
0,
],
[
FALSE,
TRUE,
'0.0',
0.0,
],
[
FALSE,
FALSE,
23,
77,
],
[
TRUE,
TRUE,
23.0,
23.0,
],
// Strings.
[
FALSE,
FALSE,
'foof',
'yay',
],
[
TRUE,
TRUE,
'yay',
'yay',
],
// Bools with type conversion.
[
TRUE,
TRUE,
TRUE,
TRUE,
],
[
TRUE,
TRUE,
FALSE,
FALSE,
],
[
FALSE,
TRUE,
NULL,
FALSE,
],
[
FALSE,
TRUE,
'TRUE',
TRUE,
],
[
FALSE,
FALSE,
'FALSE',
FALSE,
],
[
FALSE,
TRUE,
0,
FALSE,
],
[
FALSE,
TRUE,
1,
TRUE,
],
[
FALSE,
TRUE,
-1,
TRUE,
],
[
FALSE,
TRUE,
'1',
TRUE,
],
[
FALSE,
TRUE,
'1.3',
TRUE,
],
// Null.
[
FALSE,
FALSE,
'NULL',
NULL,
],
[
TRUE,
TRUE,
NULL,
NULL,
],
];
}