You are here

public function LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile in Lingotek Translation 3.5.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()
  2. 4.0.x tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()
  3. 3.0.x tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()
  4. 3.1.x tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()
  5. 3.2.x tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()
  6. 3.3.x tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()
  7. 3.4.x tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()
  8. 3.6.x tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()
  9. 3.7.x tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()
  10. 3.8.x tests/src/Functional/LingotekContentEntityGetProfileHookTest.php \Drupal\Tests\lingotek\Functional\LingotekContentEntityGetProfileHookTest::testGetProfileWithoutParentProfile()

Tests that a profile can be overridden before uploading.

File

tests/src/Functional/LingotekContentEntityGetProfileHookTest.php, line 177

Class

LingotekContentEntityGetProfileHookTest
Tests the hooks for getting content entity associated profile.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testGetProfileWithoutParentProfile() {

  // Create a node with group 1 profile.
  $edit = [];
  $edit['title[0][value]'] = 'Llamas are cool';
  $edit['body[0][value]'] = 'Llamas are very cool';
  $edit['langcode[0][value]'] = 'en';
  $this
    ->saveAndPublishNodeForm($edit);

  // Save a comment.
  $edit = [];
  $edit['subject[0][value]'] = 'First test';
  $edit['comment_body[0][value]'] = 'First test body';
  $this
    ->drupalPostForm(NULL, $edit, 'Save');
  $this
    ->saveLingotekContentTranslationSettings([
    'node' => [
      'article' => [
        'profiles' => 'manual',
        'fields' => [
          'title' => 1,
          'body' => 1,
        ],
      ],
    ],
    'comment' => [
      'comment' => [
        'profiles' => 'manual',
        'fields' => [
          'comment_body' => 1,
        ],
      ],
    ],
  ]);
  $this
    ->goToContentBulkManagementForm('comment');
  $this
    ->drupalGet('node/1');

  // Save another comment.
  $edit = [];
  $edit['subject[0][value]'] = 'Second test';
  $edit['comment_body[0][value]'] = 'Second test body';
  $this
    ->drupalPostForm(NULL, $edit, 'Save');
  $this
    ->goToContentBulkManagementForm('comment');
}