/** * Tests SortArray::sortByWeightProperty() input against expected output. * * @dataProvider providerSortByWeightProperty * @covers ::sortByWeightProperty * @covers ::sortByKeyInt * * @param array $a * The first input array for the SortArray::sortByWeightProperty() method. * @param array $b * The second input array for the SortArray::sortByWeightProperty(). * @param integer $expected * The expected output from calling the method. */ public function testSortByWeightProperty($a, $b, $expected) { $result = SortArray::sortByWeightProperty($a, $b); $this->assertBothNegativePositiveOrZero($expected, $result); }
/** * Tests SortArray::sortByWeightProperty() input against expected output. * * @dataProvider providerSortByWeightProperty * * @param array $a * The first input array for the SortArray::sortByWeightProperty() method. * @param array $b * The second input array for the SortArray::sortByWeightProperty(). * @param integer $expected * The expected output from calling the method. * * @see \Drupal\Component\Utility\SortArray::sortByWeightProperty() * @see \Drupal\Tests\Component\Utility\SortArrayTest::SortByWeightProperty() */ public function testSortByWeightProperty($a, $b, $expected) { $result = SortArray::sortByWeightProperty($a, $b); $this->assertEquals($expected, $result); }