You are here

public function WebformObjectHelperTest::providerSortByProperty in Webform 8.5

Same name and namespace in other branches
  1. 6.x tests/src/Unit/Utility/WebformObjectHelperTest.php \Drupal\Tests\webform\Unit\Utility\WebformObjectHelperTest::providerSortByProperty()

Data provider for testSortByProperty().

See also

testSortByProperty()

File

tests/src/Unit/Utility/WebformObjectHelperTest.php, line 42

Class

WebformObjectHelperTest
Tests webform object utility.

Namespace

Drupal\Tests\webform\Unit\Utility

Code

public function providerSortByProperty() {
  $object = new \stdClass();
  $object->c = 'c';
  $object->a = 'a';
  $object->b = 'b';
  $tests[] = [
    $object,
    [
      'a' => 'a',
      'b' => 'b',
      'c' => 'c',
    ],
  ];
  $object = new \stdClass();
  $object->c = 'c';
  $object->b = 'b';
  $object->a = 'a';
  $tests[] = [
    $object,
    [
      'a' => 'a',
      'b' => 'b',
      'c' => 'c',
    ],
  ];
  $object = new \stdClass();
  $object->b = 'b';
  $object->a = 'a';
  $object->_ = '_';
  $tests[] = [
    $object,
    [
      '_' => '_',
      'a' => 'a',
      'b' => 'b',
    ],
  ];
  return $tests;
}