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