NodeTranslation.php in Metatag 8
File
tests/src/Functional/NodeTranslation.php
View source
<?php
namespace Drupal\Tests\metatag\Functional;
use Drupal\Tests\BrowserTestBase;
class NodeTranslation extends BrowserTestBase {
use MetatagHelperTrait;
protected static $modules = [
'language',
'node',
'field_ui',
'user',
'token',
'metatag',
'content_translation',
];
protected $defaultTheme = 'stark';
protected function setUp() {
parent::setUp();
$this
->loginUser1();
$this
->drupalGet('/admin/config/regional/language/add');
$this
->assertSession()
->statusCodeEquals(200);
$edit = [
'predefined_langcode' => 'hu',
];
$this
->drupalPostForm(NULL, $edit, 'Add language');
$this
->drupalCreateContentType([
'type' => 'article',
]);
$this
->drupalGet('/admin/structure/types/manage/article');
$this
->assertSession()
->statusCodeEquals(200);
$edit = [
'language_configuration[content_translation]' => TRUE,
];
$this
->drupalPostForm(NULL, $edit, 'Save content type');
}
public function testContentTranslationForm() {
$this
->drupalGet('/admin/config/regional/content-language');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains('Content language');
$this
->drupalPostForm(NULL, [], 'Save configuration');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains('Settings successfully updated.');
}
}