function UrlTest::testToRenderArray

Tests deprecation of toRenderArray() method.

@covers ::toRenderArray @group legacy

File

core/tests/Drupal/Tests/Core/UrlTest.php, line 526

Class

UrlTest
@coversDefaultClass \Drupal\Core\Url @group UrlTest

Namespace

Drupal\Tests\Core

Code

public function testToRenderArray() : void {
    $this->expectDeprecation('Drupal\\Core\\Url::toRenderArray() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3342977');
    $url = Url::fromRoute('entity.node.canonical', [
        'node' => 3,
    ]);
    $this->assertIsArray($url->toRenderArray());
}

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