WebformNodeTranslationTest.php in Webform 6.x
File
modules/webform_node/tests/src/Functional/WebformNodeTranslationTest.php
View source
<?php
namespace Drupal\Tests\webform_node\Functional;
class WebformNodeTranslationTest extends WebformNodeBrowserTestBase {
public static $modules = [
'webform',
'webform_node',
'webform_node_test_translation',
];
public function testNodeTranslation() {
$node = $this
->createWebformNode('webform_node_test_translation', [
'title' => 'English node',
]);
$this
->drupalGet('/node/' . $node
->id());
$this
->assertFieldByName('computed_token', 'English node');
$node
->addTranslation('es', [
'title' => 'Spanish node',
])
->save();
$this
->drupalGet('/es/node/' . $node
->id());
$this
->assertNoFieldByName('computed_token', 'English node');
$this
->assertFieldByName('computed_token', 'Spanish node');
}
}