protected function LingotekTestBase::saveAndUnpublishNodeForm in Lingotek Translation 3.1.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
- 4.0.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
- 3.0.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
- 3.2.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
- 3.3.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
- 3.4.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
- 3.5.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
- 3.6.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
- 3.7.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
- 3.8.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::saveAndUnpublishNodeForm()
2 calls to LingotekTestBase::saveAndUnpublishNodeForm()
- LingotekNodeNestedParagraphsTranslationTest::testParagraphRevisionsAreKeptWhenTranslating in tests/
src/ Functional/ LingotekNodeNestedParagraphsTranslationTest.php - LingotekNodeParagraphsTranslationTest::testParagraphRevisionsAreKeptWhenTranslating in tests/
src/ Functional/ LingotekNodeParagraphsTranslationTest.php
File
- tests/
src/ Functional/ LingotekTestBase.php, line 294
Class
- LingotekTestBase
- Base class for Lingotek test. Performs authorization of the account.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function saveAndUnpublishNodeForm(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]'] = 'draft';
$this
->drupalPostForm($path, $edit, t('Save'));
}
else {
$edit['status[value]'] = FALSE;
$this
->drupalPostForm($path, $edit, t('Save'));
}
}