6750b1c6c022e8331f5595459afb2b5526048899
[yaffs-website] / web / core / modules / settings_tray / tests / src / Functional / BcRoutesTest.php
1 <?php
2
3 namespace Drupal\Tests\settings_tray\Functional;
4
5 use Drupal\Core\Url;
6 use Drupal\Tests\BrowserTestBase;
7
8 /**
9  * Tests Settings Tray BC routes.
10  *
11  * @group settings_tray
12  * @group legacy
13  */
14 class BcRoutesTest extends BrowserTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = [
20     'settings_tray',
21   ];
22
23   /**
24    * @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.
25    */
26   public function testOffCanvasFormRouteBc() {
27     $block = $this->placeBlock('system_powered_by_block');
28     $url_for_current_route = Url::fromRoute('entity.block.settings_tray_form', ['block' => $block->id()])->toString(TRUE)->getGeneratedUrl();
29     $url_for_bc_route = Url::fromRoute('entity.block.off_canvas_form', ['block' => $block->id()])->toString(TRUE)->getGeneratedUrl();
30     $this->assertSame($url_for_current_route, $url_for_bc_route);
31   }
32
33 }