Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / src / Functional / Menu / BreadcrumbTest.php
similarity index 97%
rename from web/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
rename to web/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
index 64c8c159774a1a3b969ad23938943c67e3ab3282..5a17d47419f4f3bb92b881c27d6c2039ca19a97b 100644 (file)
@@ -1,9 +1,10 @@
 <?php
 
-namespace Drupal\system\Tests\Menu;
+namespace Drupal\Tests\system\Functional\Menu;
 
 use Drupal\Core\Url;
 use Drupal\node\Entity\NodeType;
+use Drupal\Tests\BrowserTestBase;
 use Drupal\user\RoleInterface;
 
 /**
@@ -11,7 +12,9 @@ use Drupal\user\RoleInterface;
  *
  * @group Menu
  */
-class BreadcrumbTest extends MenuTestBase {
+class BreadcrumbTest extends BrowserTestBase {
+
+  use AssertBreadcrumbTrait;
 
   /**
    * Modules to enable.
@@ -36,6 +39,8 @@ class BreadcrumbTest extends MenuTestBase {
 
   /**
    * Test paths in the Standard profile.
+   *
+   * @var string
    */
   protected $profile = 'standard';
 
@@ -206,7 +211,7 @@ class BreadcrumbTest extends MenuTestBase {
     $edit = [
       'menu[menu_parent]' => $link->getMenuName() . ':' . $link->getPluginId(),
     ];
-    $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Save and keep published'));
+    $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Save'));
     $expected = [
       "node" => $link->getTitle(),
     ];
@@ -227,7 +232,7 @@ class BreadcrumbTest extends MenuTestBase {
     $edit = [
       'field_tags[target_id]' => implode(',', array_keys($tags)),
     ];
-    $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Save and keep published'));
+    $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Save'));
 
     // Put both terms into a hierarchy Drupal ยป Breadcrumbs. Required for both
     // the menu links and the terms itself, since taxonomy_term_page() resets
@@ -358,17 +363,17 @@ class BreadcrumbTest extends MenuTestBase {
     // user is not able to access "Administer".
     $trail = $home;
     $this->assertBreadcrumb('admin', $trail, t('Access denied'));
-    $this->assertResponse(403);
+    $this->assertSession()->statusCodeEquals(403);
 
     // Since the 'admin' path is not accessible, we still expect only the Home
     // link.
     $this->assertBreadcrumb('admin/reports', $trail, t('Reports'));
-    $this->assertNoResponse(403);
+    $this->assertSession()->statusCodeNotEquals(403);
 
     // Since the Reports page is accessible, that will show.
     $trail += ['admin/reports' => t('Reports')];
     $this->assertBreadcrumb('admin/reports/dblog', $trail, t('Recent log messages'));
-    $this->assertNoResponse(403);
+    $this->assertSession()->statusCodeNotEquals(403);
 
     // Ensure that the breadcrumb is safe against XSS.
     $this->drupalGet('menu-test/breadcrumb1/breadcrumb2/breadcrumb3');