RestSettingsDeletionUpdateTest.php

Namespace

Drupal\Tests\rest\Functional\Update

File

core/modules/rest/tests/src/Functional/Update/RestSettingsDeletionUpdateTest.php

View source
<?php

namespace Drupal\Tests\rest\Functional\Update;

use Drupal\FunctionalTests\Update\UpdatePathTestBase;

/**
 * Ensures that update hook is run properly for deleting obsolete REST settings.
 *
 * @group legacy
 */
class RestSettingsDeletionUpdateTest extends UpdatePathTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected function setDatabaseDumpFiles() {
        $this->databaseDumpFiles = [
            __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz',
        ];
    }
    
    /**
     * Ensures that update hook is run for "rest" module.
     */
    public function testUpdate() {
        $rest_settings = $this->config('rest.settings');
        $this->assertFalse($rest_settings->isNew());
        $this->runUpdates();
        $rest_settings = \Drupal::configFactory()->get('rest.settings');
        $this->assertTrue($rest_settings->isNew());
    }

}

Classes

Title Deprecated Summary
RestSettingsDeletionUpdateTest Ensures that update hook is run properly for deleting obsolete REST settings.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.