You are here

public function SortArrayTest::testSortByTitleElement in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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.

integer $expected: The expected output from calling the method.

File

core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php, line 188
Contains \Drupal\Tests\Component\Utility\SortArrayTest.

Class

SortArrayTest
Tests the SortArray component.

Namespace

Drupal\Tests\Component\Utility

Code

public function testSortByTitleElement($a, $b, $expected) {
  $result = SortArray::sortByTitleElement($a, $b);
  $this
    ->assertBothNegativePositiveOrZero($expected, $result);
}