function EntityUrlTest::testUrlInfo

Tests the urlInfo() method.

@covers ::urlInfo

@dataProvider providerTestUrlInfo

@group legacy @expectedDeprecation EntityInterface::urlInfo() is deprecated in Drupal 8.0.0 and will be removed in Drupal 9.0.0. EntityInterface::toUrl() instead. See https://www.drupal.org/node/2614344

Parameters

string $rel: The link relation to test.

array $options: An array of URL options to test with.

File

core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php, line 396

Class

EntityUrlTest
Tests URL handling of the \Drupal\Core\Entity\Entity class.

Namespace

Drupal\Tests\Core\Entity

Code

public function testUrlInfo($rel, $options) {
    $entity = $this->getEntity(EntityBase::class, [], [
        'toUrl',
    ]);
    $entity->expects($this->once())
        ->method('toUrl')
        ->with($rel, $options);
    $entity->urlInfo($rel, $options);
}

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