public function CheckEntityChangesTest::testTrackTranslatableEntityChangesNotAllLanguagesSelected in TMGMT Extension Suite 8.3
Test "Track changes of the translatable entities" feature is turned on.
Not all languages selected.
File
- tests/
src/ Functional/ CheckEntityChangesTest.php, line 185
Class
- CheckEntityChangesTest
- Class CheckEntityChangesTest.
Namespace
Drupal\Tests\tmgmt_extension_suit\FunctionalCode
public function testTrackTranslatableEntityChangesNotAllLanguagesSelected() {
$this
->requestTranslation([
1,
], 'fr', 1);
$this
->requestTranslation([
1,
], 'de', 2);
$this
->drupalPostForm('admin/tmgmt/extension-settings', [
'do_track_changes' => TRUE,
'tes_local_test_de' => 0,
'tes_local_test_fr' => 1,
], t('Save configuration'));
// Submit node edit form without changes.
// Expectations:
// 1. Hash is not changed.
// 2. Job is not added to upload queue.
$oldHash1 = $this
->getNodeHash(1, 1);
$oldHash2 = $this
->getNodeHash(1, 2);
$this
->drupalPostForm("node/1/edit", [], t('Save'));
$newHash1 = $this
->getNodeHash(1, 1);
$newHash2 = $this
->getNodeHash(1, 2);
$this
->assertEqual($oldHash1, $newHash1);
$this
->assertEqual($oldHash2, $newHash2);
$this
->assertEqual($this
->isItemAddedToQueue('tmgmt_extension_suit_upload', 1), 0);
$this
->assertEqual($this
->isItemAddedToQueue('tmgmt_extension_suit_upload', 2), 0);
// Submit node edit form with updated title.
// Expectations:
// 1. Hash is not changed.
// 2. Job is not added to upload queue.
$this
->drupalPostForm("node/1/edit", [
'title[0][value]' => 'New node test title',
], t('Save'));
$newHash1 = $this
->getNodeHash(1, 1);
$newHash2 = $this
->getNodeHash(1, 2);
$this
->assertNotEqual($oldHash1, $newHash1);
$this
->assertEqual($oldHash2, $newHash2);
$this
->assertEqual($this
->isItemAddedToQueue('tmgmt_extension_suit_upload', 1), 1);
$this
->assertEqual($this
->isItemAddedToQueue('tmgmt_extension_suit_upload', 2), 0);
}