function RestExportAuthTest::testAuthCorrection

Ensures that rest export auth settings are automatically corrected.

See also

rest_update_8401()

rest_views_presave()

\Drupal\Tests\rest\Functional\Update\RestExportAuthCorrectionUpdateTest

File

core/modules/rest/tests/src/Kernel/Views/RestExportAuthTest.php, line 50

Class

RestExportAuthTest
Tests the auth option of rest exports.

Namespace

Drupal\Tests\rest\Kernel\Views

Code

public function testAuthCorrection() {
    // Get particular view.
    $view = \Drupal::entityTypeManager()->getStorage('view')
        ->load('rest_export_with_authorization_correction');
    $displays = $view->get('display');
    $this->assertSame($displays['rest_export_1']['display_options']['auth'], [
        'cookie',
    ], 'Cookie is used for authentication');
}

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