function RestExportJsonApiUnsupported::testFormatOptions

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php \Drupal\Tests\jsonapi\Functional\RestExportJsonApiUnsupported::testFormatOptions()
  2. 10 core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php \Drupal\Tests\jsonapi\Functional\RestExportJsonApiUnsupported::testFormatOptions()
  3. 11.x core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php \Drupal\Tests\jsonapi\Functional\RestExportJsonApiUnsupported::testFormatOptions()

Tests that 'api_json' is not a RestExport format option.

File

core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php, line 45

Class

RestExportJsonApiUnsupported
Ensures that the 'api_json' format is not supported by the REST module.

Namespace

Drupal\Tests\jsonapi\Functional

Code

public function testFormatOptions() {
    $this->assertSame([
        'json' => 'serialization',
        'xml' => 'serialization',
    ], $this->container
        ->getParameter('serializer.format_providers'));
    $this->drupalGet('admin/structure/views/nojs/display/test_serializer_display_entity/rest_export_1/style_options');
    $this->assertSession()
        ->fieldExists('style_options[formats][json]');
    $this->assertSession()
        ->fieldExists('style_options[formats][xml]');
    $this->assertSession()
        ->fieldNotExists('style_options[formats][api_json]');
}

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