protected function LingotekTestBase::saveAndKeepPublishedNodeForm in Lingotek Translation 3.2.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
- 4.0.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
- 3.0.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
- 3.1.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
- 3.3.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
- 3.4.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
- 3.5.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
- 3.6.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
- 3.7.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
- 3.8.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndKeepPublishedNodeForm()
36 calls to LingotekTestBase::saveAndKeepPublishedNodeForm()
- LingotekIntelligenceMetadataTranslationTest::testUpdateNodeWithContactEmailAsAuthorSetting in tests/
src/ Functional/ LingotekIntelligenceMetadataTranslationTest.php - LingotekIntelligenceMetadataTranslationTest::testUpdateNodeWithDefaultSettings in tests/
src/ Functional/ LingotekIntelligenceMetadataTranslationTest.php - LingotekIntelligenceMetadataTranslationTest::testUpdateNodeWithGeneralSettings in tests/
src/ Functional/ LingotekIntelligenceMetadataTranslationTest.php - Tests that a node can be translated.
- LingotekIntelligenceMetadataTranslationTest::testUpdateNodeWithNoSettings in tests/
src/ Functional/ LingotekIntelligenceMetadataTranslationTest.php - LingotekIntelligenceMetadataTranslationTest::testUpdateNodeWithProfileOverride in tests/
src/ Functional/ LingotekIntelligenceMetadataTranslationTest.php
File
- tests/
src/ Functional/ LingotekTestBase.php, line 346
Class
- LingotekTestBase
- Base class for Lingotek test. Performs authorization of the account.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function saveAndKeepPublishedNodeForm(array $edit, $nid, $usePath = TRUE) {
$path = NULL;
if ($usePath) {
$path = $nid !== NULL ? "node/{$nid}/edit" : NULL;
}
$entity_definition = \Drupal::entityTypeManager()
->getDefinition('node');
$node = Node::load($nid);
$bundle = $node
->bundle();
if (\Drupal::moduleHandler()
->moduleExists('content_moderation') && \Drupal::service('content_moderation.moderation_information')
->shouldModerateEntitiesOfBundle($entity_definition, $bundle)) {
$edit['moderation_state[0][state]'] = 'published';
$this
->drupalPostForm($path, $edit, t('Save'));
}
else {
$edit['status[value]'] = TRUE;
$this
->drupalPostForm($path, $edit, t('Save'));
}
}