You are here

public function ReadOnlyModeUpdateTest::testBcReadOnlyModeSettingAdded in JSON:API 8.2

Tests jsonapi_update_8701().

File

tests/src/Functional/Update/ReadOnlyModeUpdateTest.php, line 37

Class

ReadOnlyModeUpdateTest
Tests that existing sites have the new read-only mode to "off".

Namespace

Drupal\Tests\jsonapi\Functional\Update

Code

public function testBcReadOnlyModeSettingAdded() {

  // Make sure we have the expected values before the update.
  $jsonapi_settings = $this
    ->config('jsonapi.settings');
  $this
    ->assertFalse(array_key_exists('read_only', $jsonapi_settings
    ->getRawData()));
  $this
    ->runUpdates();

  // Make sure we have the expected values after the update.
  $jsonapi_settings = $this
    ->config('jsonapi.settings');
  $this
    ->assertTrue(array_key_exists('read_only', $jsonapi_settings
    ->getRawData()));
  $this
    ->assertFalse($jsonapi_settings
    ->get('read_only'));
}