@@ -27,7 +27,7 @@ class ContentModerationTranslationTest extends InlineEntityFormTestBase {
/**
* {@inheritdoc}
*/
protectedfunctionsetUp(){
protectedfunctionsetUp():void{
parent::setUp();
$this->user=$this->createUser([
...
...
@@ -89,22 +89,22 @@ class ContentModerationTranslationTest extends InlineEntityFormTestBase {
$this->drupalGet('node/add/ief_test_complex');
// Reference the German node.
$this->drupalPostAjaxForm(NULL,[],$this->getButtonName('//input[@type="submit" and @value="Add existing node" and @data-drupal-selector="edit-multi-actions-ief-add-existing"]'));
$this->submitForm(NULL,[],$this->getButtonName('//input[@type="submit" and @value="Add existing node" and @data-drupal-selector="edit-multi-actions-ief-add-existing"]'));
$this->drupalPostAjaxForm(NULL,$edit,$this->getButtonName('//input[@type="submit" and @data-drupal-selector="edit-multi-form-actions-ief-reference-save"]'));
$this->submitForm(NULL,$edit,$this->getButtonName('//input[@type="submit" and @data-drupal-selector="edit-multi-form-actions-ief-reference-save"]'));
$this->assertSession()->statusCodeEquals(200,'Adding a new referenced entity was successful.');
// Add a new English inline node.
$this->drupalPostAjaxForm(NULL,[],$this->getButtonName('//input[@type="submit" and @value="Add new node" and @data-drupal-selector="edit-multi-actions-ief-add"]'));
$this->submitForm(NULL,[],$this->getButtonName('//input[@type="submit" and @value="Add new node" and @data-drupal-selector="edit-multi-actions-ief-add"]'));
$this->drupalPostAjaxForm(NULL,$edit,$this->getButtonName('//input[@type="submit" and @value="Create node" and @data-drupal-selector="edit-multi-form-inline-entity-form-actions-ief-add-save"]'));
$this->submitForm(NULL,$edit,$this->getButtonName('//input[@type="submit" and @value="Create node" and @data-drupal-selector="edit-multi-form-inline-entity-form-actions-ief-add-save"]'));
$this->assertSession()->statusCodeEquals(200,'Creating a new inline entity was successful.');
$edit=[
...
...
@@ -139,7 +139,7 @@ class ContentModerationTranslationTest extends InlineEntityFormTestBase {
$this->assertEquals((string)$widget_title_element[0],'Multiple nodes','The widget has the expected title.');
...
...
@@ -147,24 +147,24 @@ class ContentModerationTranslationTest extends InlineEntityFormTestBase {
$this->assertFalse((bool)$this->xpath('//input[@type="submit" and @value="Add new node" and @data-drupal-selector="edit-multi-actions-ief-add"]'),'Add new node button does not appear in the table.');
$this->assertFalse((bool)$this->xpath('//input[@type="submit" and @value="Remove"]'),'Remove button does not appear in the table.');
// Confirm the presence of the two node titles, in the expected languages.
$this->assertTrue((bool)$this->xpath('//td[@class="inline-entity-form-node-label" and contains(.,"An inline node in French")]'),'First inline node title appears in the table');
$this->assertTrue((bool)$this->xpath('//td[@class="inline-entity-form-node-label" and contains(.,"Another inline node")]'),'Second node title appears in the table');
$this->assertNotEmpty((bool)$this->xpath('//td[@class="inline-entity-form-node-label" and contains(.,"An inline node in French")]'),'First inline node title appears in the table');
$this->assertNotEmpty((bool)$this->xpath('//td[@class="inline-entity-form-node-label" and contains(.,"Another inline node")]'),'Second node title appears in the table');
// Edit the translations of both inline entities.
$this->drupalPostAjaxForm(NULL,[],$this->getButtonName('//input[@type="submit" and @value="Edit" and @data-drupal-selector="edit-multi-entities-0-actions-ief-entity-edit"]'));
$this->submitForm(NULL,[],$this->getButtonName('//input[@type="submit" and @value="Edit" and @data-drupal-selector="edit-multi-entities-0-actions-ief-entity-edit"]'));
$this->assertSession()->pageTextNotContains('Last name','The non-translatable last_name field is hidden.');
$edit=[
'multi[form][inline_entity_form][entities][0][form][title][0][value]'=>'An inline node in French!',
$this->drupalPostAjaxForm(NULL,$edit,$this->getButtonName('//input[@type="submit" and @value="Update node" and @data-drupal-selector="edit-multi-form-inline-entity-form-entities-0-form-actions-ief-edit-save"]'));
$this->submitForm(NULL,$edit,$this->getButtonName('//input[@type="submit" and @value="Update node" and @data-drupal-selector="edit-multi-form-inline-entity-form-entities-0-form-actions-ief-edit-save"]'));
$this->drupalPostAjaxForm(NULL,[],$this->getButtonName('//input[@type="submit" and @value="Edit" and @data-drupal-selector="edit-multi-entities-1-actions-ief-entity-edit"]'));
$this->submitForm(NULL,[],$this->getButtonName('//input[@type="submit" and @value="Edit" and @data-drupal-selector="edit-multi-entities-1-actions-ief-entity-edit"]'));
$edit=[
'multi[form][inline_entity_form][entities][1][form][title][0][value]'=>'Another inline node in French!',
$this->drupalPostAjaxForm(NULL,$edit,$this->getButtonName('//input[@type="submit" and @value="Update node" and @data-drupal-selector="edit-multi-form-inline-entity-form-entities-1-form-actions-ief-edit-save"]'));
$this->submitForm(NULL,$edit,$this->getButtonName('//input[@type="submit" and @value="Update node" and @data-drupal-selector="edit-multi-form-inline-entity-form-entities-1-form-actions-ief-edit-save"]'));