protected function importFile($translated_file, $translated_text, JobInterface $job)
 {
     // To test the upload form functionality, navigate to the edit form.
     $edit = array('files[file]' => $translated_file);
     $this->drupalPostForm($job->urlInfo(), $edit, t('Import'));
     // Make sure the translations have been imported correctly.
     $this->assertNoRaw('title="In progress"');
     // @todo: Enable this assertion once new releases for views and entity
     // module are out.
     //$this->assertText(t('Needs review'));
     // Review both items.
     $this->clickLink(t('Review'));
     foreach ($translated_text[1] as $key => $value) {
         $this->assertText($value);
     }
     foreach ($translated_text[2] as $key => $value) {
         $this->assertNoText($value);
     }
     $this->drupalPostForm(NULL, array(), t('Save as completed'));
     // Review both items.
     $this->clickLink(t('Review'));
     foreach ($translated_text[1] as $key => $value) {
         $this->assertNoText($value);
     }
     foreach ($translated_text[2] as $key => $value) {
         $this->assertText($value);
     }
     $this->drupalPostForm(NULL, array(), t('Save as completed'));
     // @todo: Enable this assertion once new releases for views and entity
     // module are out.
     //$this->assertText(t('Accepted'));
     $this->assertText(t('Finished'));
     $this->assertNoRaw('title="Needs review"');
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function delete(array $form, FormStateInterface $form_state)
 {
     $form_state->setRedirectUrl($this->entity->urlInfo('delete-form'));
 }