public function LingotekMetadataEditFormTest::testMetadataLocalTaskAvailable in Lingotek Translation 8
Tests that if debug is not enabled, metadata tab is not available.
File
- src/
Tests/ Form/ LingotekMetadataEditFormTest.php, line 80
Class
- LingotekMetadataEditFormTest
- Tests the Lingotek metadata form.
Namespace
Drupal\lingotek\Tests\FormCode
public function testMetadataLocalTaskAvailable() {
// Enable debug operations.
$this
->drupalPostForm('admin/lingotek/settings', [], 'Enable debug operations');
// Create a node.
$edit = array();
$edit['title[0][value]'] = 'Llamas are cool';
$edit['body[0][value]'] = 'Llamas are very cool';
$edit['langcode[0][value]'] = 'en';
$edit['lingotek_translation_profile'] = 'automatic';
$this
->drupalPostForm('node/add/article', $edit, t('Save and publish'));
$this
->assertUrl('/node/1', [], 'Node has been created.');
// The metadata local task should be visible.
$this
->drupalGet('/node/1');
$this
->assertLink(t('Lingotek Metadata'));
}