Issue #2870441 by naveenvalecha, dawehner, Lendude: Convert web tests to browser tests for content_translation module
parent
f2d177a079
commit
29045807f8
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\content_translation\Tests;
|
||||
namespace Drupal\Tests\content_translation\Functional;
|
||||
|
||||
/**
|
||||
* Tests the test content translation UI with the test entity.
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\content_translation\Tests;
|
||||
namespace Drupal\Tests\content_translation\Functional;
|
||||
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<?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 @@ class ContentTranslationEnableTest extends WebTestBase {
|
|||
// 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 @@ class ContentTranslationEnableTest extends WebTestBase {
|
|||
// 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.
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\content_translation\Tests;
|
||||
namespace Drupal\Tests\content_translation\Functional;
|
||||
|
||||
use Drupal\language\Entity\ConfigurableLanguage;
|
||||
use Drupal\node\Tests\NodeTestBase;
|
|
@ -1,6 +1,6 @@
|
|||
<?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\Field\Entity\BaseFieldOverride;
|
|||
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 @@ class ContentTranslationSettingsTest extends WebTestBase {
|
|||
$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]);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
<?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 @@ use Drupal\file\Entity\File;
|
|||
*/
|
||||
class ContentTranslationSyncImageTest extends ContentTranslationTestBase {
|
||||
|
||||
use TestFileCreationTrait {
|
||||
getTestFiles as drupalGetTestFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* The cardinality of the image field.
|
||||
*
|
|
@ -1,8 +1,8 @@
|
|||
<?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;
|
Loading…
Reference in New Issue