function BcRoutesTest::testOffCanvasFormRouteBc

@expectedDeprecation The 'entity.block.off_canvas_form' route is deprecated since version 8.5.x and will be removed in 9.0.0. Use the 'entity.block.settings_tray_form' route instead.

File

core/modules/settings_tray/tests/src/Kernel/BcRoutesTest.php, line 31

Class

BcRoutesTest
Tests Settings Tray BC routes.

Namespace

Drupal\Tests\settings_tray\Kernel

Code

public function testOffCanvasFormRouteBc() {
    $block = $this->placeBlock('system_powered_by_block');
    $url_for_current_route = Url::fromRoute('entity.block.settings_tray_form', [
        'block' => $block->id(),
    ])
        ->toString(TRUE)
        ->getGeneratedUrl();
    $url_for_bc_route = Url::fromRoute('entity.block.off_canvas_form', [
        'block' => $block->id(),
    ])
        ->toString(TRUE)
        ->getGeneratedUrl();
    $this->assertSame($url_for_current_route, $url_for_bc_route);
}

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