public function WebformObjectHelperTest::testSortByProperty in Webform 8.5
Same name and namespace in other branches
- 6.x tests/src/Unit/Utility/WebformObjectHelperTest.php \Drupal\Tests\webform\Unit\Utility\WebformObjectHelperTest::testSortByProperty()
Tests sorting object by properties.
@dataProvider providerSortByProperty
Parameters
object $object: The object to run through WebformObjectHelper::sortByProperty().
array $expected: The expected result from calling the function.
See also
WebformObjectHelper::sortByProperty()
File
- tests/
src/ Unit/ Utility/ WebformObjectHelperTest.php, line 29
Class
- WebformObjectHelperTest
- Tests webform object utility.
Namespace
Drupal\Tests\webform\Unit\UtilityCode
public function testSortByProperty($object, array $expected) {
$result = (array) WebformObjectHelper::sortByProperty($object);
$this
->assertEquals(implode('|', array_keys($expected)), implode('|', array_keys($result)));
}