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 <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21Entity.php/class/Entity/8.9.x" title="Defines a base entity class." class="local">\Drupal\Core\Entity\Entity</a> 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.