public function RestExportAuthTest::testAuthCorrection in Drupal 8
Ensures that rest export auth settings are automatically corrected.
See also
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\ViewsCode
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');
}