LingotekActionsInstalledUpdate8216Test.php in Lingotek Translation 8.2
File
tests/src/Functional/Update/LingotekActionsInstalledUpdate8216Test.php
View source
<?php
namespace Drupal\Tests\lingotek\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
use Drupal\system\Entity\Action;
class LingotekActionsInstalledUpdate8216Test 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.pre8216.php.gz',
];
}
public function testUpgrade() {
$actions = Action::loadMultiple();
$this
->assertCount(34, $actions);
$this
->runUpdates();
$actions = Action::loadMultiple();
$this
->assertCount(34 + 4 + 3, $actions);
$expectedActions = [
'node_lingotek_delete_translations_action',
'node_es_lingotek_delete_translation_action',
'node_en_lingotek_delete_translation_action',
'node_de_lingotek_delete_translation_action',
];
foreach ($expectedActions as $expectedAction) {
$this
->assertArrayHasKey($expectedAction, $actions, 'There is an action with id: ' . $expectedAction);
}
}
}