public function LingotekConfigBulkFormTest::testJobIdOnUpload in Lingotek Translation 3.1.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
- 4.0.x tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
- 3.0.x tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
- 3.2.x tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
- 3.3.x tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
- 3.4.x tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
- 3.5.x tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
- 3.6.x tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
- 3.7.x tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
- 3.8.x tests/src/Functional/Form/LingotekConfigBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekConfigBulkFormTest::testJobIdOnUpload()
Tests job id is uploaded on upload.
File
- tests/
src/ Functional/ Form/ LingotekConfigBulkFormTest.php, line 140
Class
- LingotekConfigBulkFormTest
- Tests the config bulk management form.
Namespace
Drupal\Tests\lingotek\Functional\FormCode
public function testJobIdOnUpload() {
$assert_session = $this
->assertSession();
// Go and upload a field.
$this
->goToConfigBulkManagementForm('node_type');
$basepath = \Drupal::request()
->getBasePath();
// I can init the upload of content.
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/upload/node_type/article?destination=' . $basepath . '/admin/lingotek/config/manage');
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/upload/node_type/page?destination=' . $basepath . '/admin/lingotek/config/manage');
$edit = [
'table[article]' => TRUE,
'table[page]' => TRUE,
'job_id' => 'my_custom_job_id',
$this
->getBulkOperationFormName() => $this
->getBulkOperationNameForUpload('node_type'),
];
$this
->drupalPostForm(NULL, $edit, $this
->getApplyActionsButtonLabel());
$this
->assertEquals('en_US', \Drupal::state()
->get('lingotek.uploaded_locale'));
$this
->assertEquals('my_custom_job_id', \Drupal::state()
->get('lingotek.uploaded_job_id'));
/** @var \Drupal\lingotek\Entity\LingotekConfigMetadata[] $metadatas */
$metadatas = LingotekConfigMetadata::loadMultiple();
foreach ($metadatas as $metadata) {
$this
->assertEquals('my_custom_job_id', $metadata
->getJobId(), 'The job id was saved along with metadata.');
}
// The column for Job ID exists and there are values.
$this
->assertText('Job ID');
$this
->assertText('my_custom_job_id');
}