You are here

public function CheckEntityChangesTest::testDoNotTrackTranslatableEntityChangesIfNoLanguagesSelected in TMGMT Extension Suite 8.3

Test "Track changes of the translatable entities" feature is turned on.

But languages are not selected.

File

tests/src/Functional/CheckEntityChangesTest.php, line 109

Class

CheckEntityChangesTest
Class CheckEntityChangesTest.

Namespace

Drupal\Tests\tmgmt_extension_suit\Functional

Code

public function testDoNotTrackTranslatableEntityChangesIfNoLanguagesSelected() {
  $this
    ->requestTranslation([
    1,
  ], 'fr', 1);

  // Disable tracking feature.
  $this
    ->drupalPostForm('admin/tmgmt/extension-settings', [
    'do_track_changes' => TRUE,
    'tes_local_test_de' => 0,
    'tes_local_test_fr' => 0,
  ], t('Save configuration'));

  // Submit node edit form without changes.
  // Expectations:
  // 1. Hash is not changed.
  // 2. Job is not added to upload queue.
  $oldHash = $this
    ->getNodeHash(1, 1);
  $this
    ->drupalPostForm("node/1/edit", [], t('Save'));
  $newHash = $this
    ->getNodeHash(1, 1);
  $this
    ->assertEqual($oldHash, $newHash);
  $this
    ->assertEqual($this
    ->isItemAddedToQueue('tmgmt_extension_suit_upload', 1), 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'));
  $newHash = $this
    ->getNodeHash(1, 1);
  $this
    ->assertEqual($oldHash, $newHash);
  $this
    ->assertEqual($this
    ->isItemAddedToQueue('tmgmt_extension_suit_upload', 1), 0);
}