You are here

public function ReadOnlyModeUpdateTest::testBcReadOnlyModeSettingAdded in Drupal 8

Tests jsonapi_update_8701().

File

core/modules/jsonapi/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'));
}