<?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;
/**
*
* @group Menu
*/
-class BreadcrumbTest extends MenuTestBase {
+class BreadcrumbTest extends BrowserTestBase {
+
+ use AssertBreadcrumbTrait;
/**
* Modules to enable.
/**
* Test paths in the Standard profile.
+ *
+ * @var string
*/
protected $profile = 'standard';
$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(),
];
$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
// 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');