LingotekActionsInstalledUpdate8210Test.php in Lingotek Translation 8.2
File
tests/src/Functional/Update/LingotekActionsInstalledUpdate8210Test.php
View source
<?php
namespace Drupal\Tests\lingotek\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
use Drupal\system\Entity\Action;
class LingotekActionsInstalledUpdate8210Test 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.pre8210.php.gz',
];
}
public function testUpgrade() {
$actions = Action::loadMultiple();
$this
->assertCount(19, $actions);
$this
->runUpdates();
$actions = Action::loadMultiple();
$this
->assertCount(19 + 6 + 9 + 4 + 3, $actions);
$expectedActions = [
'node_lingotek_upload_action',
'node_lingotek_check_upload_action',
'node_lingotek_request_translations_action',
'node_lingotek_check_translations_action',
'node_lingotek_download_translations_action',
'node_lingotek_cancel_action',
];
foreach ($expectedActions as $expectedAction) {
$this
->assertArrayHasKey($expectedAction, $actions, 'There is an action with id: ' . $expectedAction);
}
}
}