UpdatePostUpdateFailingTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/Update/UpdatePostUpdateFailingTest.php
View source
<?php
namespace Drupal\system\Tests\Update;
class UpdatePostUpdateFailingTest extends UpdatePathTestBase {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
__DIR__ . '/../../../tests/fixtures/update/drupal-8.update-test-postupdate-failing-enabled.php',
];
}
public function testPostUpdate() {
$this->checkFailedUpdates = FALSE;
$this
->runUpdates();
$this
->assertIdentical([], \Drupal::state()
->get('post_update_test_execution', []));
$key_value = \Drupal::keyValue('update__post_update');
$this
->assertEqual([], $key_value
->get('existing_updates'));
}
protected function doSelectionTest() {
$this
->assertRaw('8001 - This update will fail.');
$this
->assertRaw('8002 - A further update.');
$this
->assertEscaped("First update, should not be run since this module's update hooks fail.");
}
}