function SortArrayTest::testSortByTitleElement
Same name in other branches
- 9 core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php \Drupal\Tests\Component\Utility\SortArrayTest::testSortByTitleElement()
- 8.9.x core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php \Drupal\Tests\Component\Utility\SortArrayTest::testSortByTitleElement()
- 11.x core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php \Drupal\Tests\Component\Utility\SortArrayTest::testSortByTitleElement()
Tests SortArray::sortByTitleElement() input against expected output.
@dataProvider providerSortByTitleElement @covers ::sortByTitleElement @covers ::sortByKeyString
Parameters
array $a: The first input item for comparison.
array $b: The second item for comparison.
int $expected: The expected output from calling the method.
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ SortArrayTest.php, line 185
Class
- SortArrayTest
- Tests the SortArray component.
Namespace
Drupal\Tests\Component\UtilityCode
public function testSortByTitleElement($a, $b, $expected) : void {
$result = SortArray::sortByTitleElement($a, $b);
$this->assertBothNegativePositiveOrZero($expected, $result);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.