LingotekTargetStatusFormatterUpdate8209Test.php in Lingotek Translation 8.2
File
tests/src/Functional/Update/LingotekTargetStatusFormatterUpdate8209Test.php
View source
<?php
namespace Drupal\Tests\lingotek\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
class LingotekTargetStatusFormatterUpdate8209Test extends UpdatePathTestBase {
protected $configFactory;
protected function setUp() {
parent::setUp();
$this->configFactory = $this->container
->get('config.factory');
}
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../fixtures/update/drupal-8.lingotek.standard.pre8209.php.gz',
__DIR__ . '/../../../fixtures/update/lingotektargetstatusupgrade2985742.php',
];
}
public function testUpgrade() {
$view = $this->configFactory
->get('views.view.lingotektargetstatusupgrade2985742');
$field_type = $view
->get('display.default.display_options.fields.translation_status_value.type');
$this
->assertEquals($field_type, 'lingotek_translation_status');
$this
->runUpdates();
$view = $this->configFactory
->get('views.view.lingotektargetstatusupgrade2985742');
$field_type = $view
->get('display.default.display_options.fields.translation_status_value.type');
$this
->assertEquals($field_type, 'lingotek_translation_statuses');
$basepath = \Drupal::request()
->getBasePath();
$this
->drupalGet('/lingotektargetstatusupgrade2985742');
$this
->assertSession()
->responseNotContains('IGNORED-SEPARATOR');
$this
->assertSession()
->responseContains('<a href="' . $basepath . '/admin/lingotek/entity/add_target/document_id_1/de_DE?destination=' . $basepath . '/lingotektargetstatusupgrade2985742" class="language-icon target-request" title="German - Request translation">DE</a><a href="' . $basepath . '/admin/lingotek/workbench/document_id_1/es_ES" target="_blank" class="language-icon target-current" title="Spanish - Current">ES</a>');
}
}