function LinkTest::testLinkComparison

Same name in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php \Drupal\Tests\jsonapi\Unit\JsonApiResource\LinkTest::testLinkComparison()
  2. 10 core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php \Drupal\Tests\jsonapi\Unit\JsonApiResource\LinkTest::testLinkComparison()
  3. 11.x core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php \Drupal\Tests\jsonapi\Unit\JsonApiResource\LinkTest::testLinkComparison()

@covers ::compare @dataProvider linkComparisonProvider

File

core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php, line 25

Class

LinkTest
@coversDefaultClass \Drupal\jsonapi\JsonApiResource\Link @group jsonapi

Namespace

Drupal\Tests\jsonapi\Unit\JsonApiResource

Code

public function testLinkComparison(Link $a, Link $b, $expected) {
    $actual = Link::compare($a, $b);
    $this->assertSame($expected, $actual === 0);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.