Commit 29045807 authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #2870441 by naveenvalecha, dawehner, Lendude: Convert web tests to...

Issue #2870441 by naveenvalecha, dawehner, Lendude: Convert web tests to browser tests for content_translation module
parent f2d177a0
<?php
namespace Drupal\content_translation\Tests;
namespace Drupal\Tests\content_translation\Functional;
/**
* Tests the test content translation UI with the test entity.
......
<?php
namespace Drupal\content_translation\Tests;
namespace Drupal\Tests\content_translation\Functional;
use Drupal\Tests\BrowserTestBase;
......
<?php
namespace Drupal\content_translation\Tests;
namespace Drupal\Tests\content_translation\Functional;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Test enabling content translation module.
*
* @group content_translation
*/
class ContentTranslationEnableTest extends WebTestBase {
class ContentTranslationEnableTest extends BrowserTestBase {
/**
* {@inheritdoc}
......@@ -36,7 +36,7 @@ public function testEnable() {
// No pending updates should be available.
$this->drupalGet('admin/reports/status');
$requirement_value = $this->cssSelect("details.system-status-report__entry summary:contains('Entity/field definitions') + div");
$this->assertEqual(t('Up to date'), trim((string) $requirement_value[0]));
$this->assertEqual(t('Up to date'), trim($requirement_value[0]->getText()));
$this->drupalGet('admin/config/regional/content-language');
// The node entity type should not be an option because it has no bundles.
......@@ -54,7 +54,7 @@ public function testEnable() {
// No pending updates should be available.
$this->drupalGet('admin/reports/status');
$requirement_value = $this->cssSelect("details.system-status-report__entry summary:contains('Entity/field definitions') + div");
$this->assertEqual(t('Up to date'), trim((string) $requirement_value[0]));
$this->assertEqual(t('Up to date'), trim($requirement_value[0]->getText()));
// Create a node type and check the content translation settings are now
// available for nodes.
......
<?php
namespace Drupal\content_translation\Tests;
namespace Drupal\Tests\content_translation\Functional;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\node\Tests\NodeTestBase;
......
<?php
namespace Drupal\content_translation\Tests;
namespace Drupal\Tests\content_translation\Functional;
use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\comment\Tests\CommentTestTrait;
......@@ -8,14 +8,14 @@
use Drupal\Core\Language\Language;
use Drupal\field\Entity\FieldConfig;
use Drupal\language\Entity\ContentLanguageSettings;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Tests the content translation settings UI.
*
* @group content_translation
*/
class ContentTranslationSettingsTest extends WebTestBase {
class ContentTranslationSettingsTest extends BrowserTestBase {
use CommentTestTrait;
......@@ -193,7 +193,7 @@ public function testSettingsUI() {
$elements = $this->xpath('//select[@id="edit-settings-node-article-settings-language-langcode"]/option');
// Compare values inside the option elements with expected values.
for ($i = 0; $i < count($elements); $i++) {
$this->assertEqual($elements[$i]->attributes()->{'value'}, $expected_elements[$i]);
$this->assertEqual($elements[$i]->getValue(), $expected_elements[$i]);
}
}
......
<?php
namespace Drupal\content_translation\Tests;
namespace Drupal\Tests\content_translation\Functional;
use Drupal\Core\Entity\EntityInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\file\Entity\File;
use Drupal\Tests\TestFileCreationTrait;
/**
* Tests the field synchronization behavior for the image field.
......@@ -14,6 +15,10 @@
*/
class ContentTranslationSyncImageTest extends ContentTranslationTestBase {
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
}
/**
* The cardinality of the image field.
*
......
<?php
namespace Drupal\content_translation\Tests\Views;
namespace Drupal\Tests\content_translation\Functional\Views;
use Drupal\content_translation\Tests\ContentTranslationTestBase;
use Drupal\Tests\content_translation\Functional\ContentTranslationTestBase;
use Drupal\views\Tests\ViewTestData;
use Drupal\Core\Language\Language;
use Drupal\user\Entity\User;
......
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