Commit e2b46f13 authored by alexpott's avatar alexpott
Browse files

Issue #2870451 by andypost, snetcher, michielnugter, dawehner: Convert web...

Issue #2870451 by andypost, snetcher, michielnugter, dawehner: Convert web tests to browser tests for menu_link_content module
parent 0493d9fb
......@@ -2,6 +2,7 @@
namespace Drupal\Tests\content_translation\Functional;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\Core\Entity\EntityInterface;
......@@ -226,10 +227,10 @@ protected function doTestTranslationOverview() {
$language = new Language(['id' => $langcode]);
$view_url = $entity->url('canonical', ['language' => $language]);
$elements = $this->xpath('//table//a[@href=:href]', [':href' => $view_url]);
$this->assertEqual((string) $elements[0], $entity->getTranslation($langcode)->label(), format_string('Label correctly shown for %language translation.', ['%language' => $langcode]));
$this->assertEqual($elements[0]->getText(), $entity->getTranslation($langcode)->label(), new FormattableMarkup('Label correctly shown for %language translation.', ['%language' => $langcode]));
$edit_path = $entity->url('edit-form', ['language' => $language]);
$elements = $this->xpath('//table//ul[@class="dropbutton"]/li/a[@href=:href]', [':href' => $edit_path]);
$this->assertEqual((string) $elements[0], t('Edit'), format_string('Edit link correct for %language translation.', ['%language' => $langcode]));
$this->assertEqual($elements[0]->getText(), t('Edit'), new FormattableMarkup('Edit link correct for %language translation.', ['%language' => $langcode]));
}
}
}
......
<?php
namespace Drupal\menu_link_content\Tests;
namespace Drupal\Tests\menu_link_content\Functional;
use Drupal\menu_link_content\Entity\MenuLinkContent;
use Drupal\simpletest\WebTestBase;
use Drupal\system\Entity\Menu;
use Drupal\Tests\BrowserTestBase;
/**
* Tests the menu link content delete UI.
*
* @group Menu
*/
class MenuLinkContentDeleteFormTest extends WebTestBase {
class MenuLinkContentDeleteFormTest extends BrowserTestBase {
/**
* Modules to enable.
......
<?php
namespace Drupal\menu_link_content\Tests;
namespace Drupal\Tests\menu_link_content\Functional;
use Drupal\menu_link_content\Entity\MenuLinkContent;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Tests the menu link content UI.
*
* @group Menu
*/
class MenuLinkContentFormTest extends WebTestBase {
class MenuLinkContentFormTest extends BrowserTestBase {
/**
* Modules to enable.
......@@ -77,7 +77,7 @@ public function testMenuLinkContentForm() {
$this->drupalGet('admin/structure/menu/manage/admin/add');
$element = $this->xpath('//select[@id = :id]/option[@selected]', [':id' => 'edit-menu-parent']);
$this->assertTrue($element, 'A default menu parent was found.');
$this->assertEqual('admin:', $element[0]['value'], '<Administration> menu is the parent.');
$this->assertEqual('admin:', $element[0]->getValue(), '<Administration> menu is the parent.');
$this->drupalPostForm(
NULL,
......
<?php
namespace Drupal\menu_link_content\Tests;
namespace Drupal\Tests\menu_link_content\Functional;
use Drupal\content_translation\Tests\ContentTranslationUITestBase;
use Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase;
use Drupal\menu_link_content\Entity\MenuLinkContent;
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment