function MarkupInterfaceComparatorTest::dataSetProvider
Same name in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/Test/Comparator/MarkupInterfaceComparatorTest.php \Drupal\KernelTests\Core\Test\Comparator\MarkupInterfaceComparatorTest::dataSetProvider()
- 10 core/tests/Drupal/KernelTests/Core/Test/Comparator/MarkupInterfaceComparatorTest.php \Drupal\KernelTests\Core\Test\Comparator\MarkupInterfaceComparatorTest::dataSetProvider()
- 11.x core/tests/Drupal/KernelTests/Core/Test/Comparator/MarkupInterfaceComparatorTest.php \Drupal\KernelTests\Core\Test\Comparator\MarkupInterfaceComparatorTest::dataSetProvider()
Provides test data for the comparator.
Return value
array Each array entry has:
- test expected value,
- test actual value,
- a bool indicating the expected return value of ::accepts,
- a value indicating the expected result of ::assertEquals, TRUE if comparison should match, FALSE if error, or a class name of an object thrown.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Test/ Comparator/ MarkupInterfaceComparatorTest.php, line 58
Class
Namespace
Drupal\KernelTests\Core\Test\ComparatorCode
public function dataSetProvider() {
return [
'FormattableMarkup vs FormattableMarkup, equal' => [
new FormattableMarkup('goldfinger', []),
new FormattableMarkup('goldfinger', []),
TRUE,
TRUE,
],
'FormattableMarkup vs FormattableMarkup, not equal' => [
new FormattableMarkup('goldfinger', []),
new FormattableMarkup('moonraker', []),
TRUE,
ComparisonFailure::class,
],
'FormattableMarkup vs string, equal' => [
new FormattableMarkup('goldfinger', []),
'goldfinger',
TRUE,
TRUE,
],
'string vs FormattableMarkup, equal' => [
'goldfinger',
new FormattableMarkup('goldfinger', []),
TRUE,
TRUE,
],
'TranslatableMarkup vs FormattableMarkup, equal' => [
new TranslatableMarkup('goldfinger'),
new FormattableMarkup('goldfinger', []),
TRUE,
TRUE,
],
'TranslatableMarkup vs string, not equal' => [
new TranslatableMarkup('goldfinger'),
'moonraker',
TRUE,
ComparisonFailure::class,
],
'TranslatableMarkup vs int, equal' => [
new TranslatableMarkup('1234'),
1234,
TRUE,
TRUE,
],
'int vs TranslatableMarkup, equal' => [
1234,
new TranslatableMarkup('1234'),
TRUE,
TRUE,
],
'FormattableMarkup vs array' => [
new FormattableMarkup('goldfinger', []),
[
'goldfinger',
],
FALSE,
PHP_VERSION_ID >= 80000 ? Warning::class : Notice::class,
],
'stdClass vs TranslatableMarkup' => [
(object) [
'goldfinger',
],
new TranslatableMarkup('goldfinger'),
FALSE,
FALSE,
],
'string vs string, equal' => [
'goldfinger',
'goldfinger',
FALSE,
TRUE,
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.