public function LingotekViewsFunctionalTests::testNodeWithMetadataView in Lingotek Translation 8.2
Same name and namespace in other branches
- 4.0.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
- 3.0.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
- 3.1.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
- 3.2.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
- 3.3.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
- 3.4.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
- 3.5.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
- 3.6.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
- 3.7.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
- 3.8.x tests/src/Functional/LingotekViewsFunctionalTests.php \Drupal\Tests\lingotek\Functional\LingotekViewsFunctionalTests::testNodeWithMetadataView()
File
- tests/
src/ Functional/ LingotekViewsFunctionalTests.php, line 73
Class
- LingotekViewsFunctionalTests
- Tests the views integrations for Lingotek.
Namespace
Drupal\Tests\lingotek\FunctionalCode
public function testNodeWithMetadataView() {
$this
->drupalGet('lingotek/views/node_and_lingotek_metadata');
$this
->assertSession()
->elementTextContains('css', 'h1.page-title', 'Node view with metadata relationship');
$this
->assertSession()
->elementExists('css', '.view-node-and-lingotek-metadata');
$edit = [];
$edit['title[0][value]'] = 'Llamas are cool';
$edit['body[0][value]'] = 'Llamas are very cool';
$edit['langcode[0][value]'] = 'en';
$edit['lingotek_translation_management[lingotek_translation_profile]'] = 'manual';
$this
->saveAndPublishNodeForm($edit);
$this
->drupalGet('lingotek/views/node_and_lingotek_metadata');
$this
->assertSession()
->elementExists('css', '.view-node-and-lingotek-metadata');
$this
->assertLink('Llamas are cool');
$this
->assertSession()
->elementTextContains('css', 'td.views-field-translation-source', 'EN');
$this
->assertSession()
->elementTextNotContains('css', 'td.views-field-document-id', 'dummy-document-hash-id');
$this
->assertSession()
->elementTextNotContains('css', 'td.views-field-translation-status-value', 'EN');
$this
->assertLink('Manual');
$this
->saveAndKeepPublishedNodeForm([
'lingotek_translation_management[lingotek_translation_profile]' => 'automatic',
], 1);
$this
->drupalGet('lingotek/views/node_and_lingotek_metadata');
$this
->assertSession()
->elementExists('css', '.view-node-and-lingotek-metadata');
$this
->assertLink('Llamas are cool');
$this
->assertSession()
->elementTextContains('css', 'td.views-field-translation-source', 'EN');
$this
->assertSession()
->elementTextContains('css', 'td.views-field-document-id', 'dummy-document-hash-id');
$this
->assertSession()
->elementTextNotContains('css', 'td.views-field-translation-status-value', 'EN');
$this
->assertSession()
->elementTextContains('css', 'td.views-field-translation-status-value', 'ES');
$this
->assertLink('Automatic');
}