class RestExportJsonApiUnsupported
Same name and namespace in other branches
- 10 core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php \Drupal\Tests\jsonapi\Functional\RestExportJsonApiUnsupported
- 8.9.x core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php \Drupal\Tests\jsonapi\Functional\RestExportJsonApiUnsupported
Ensures that the 'api_json' format is not supported by the REST module.
@group jsonapi
@internal
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\jsonapi\Functional\RestExportJsonApiUnsupported extends \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of RestExportJsonApiUnsupported
File
-
core/
modules/ jsonapi/ tests/ src/ Functional/ RestExportJsonApiUnsupported.php, line 14
Namespace
Drupal\Tests\jsonapi\FunctionalView source
class RestExportJsonApiUnsupported extends ViewTestBase {
/**
* {@inheritdoc}
*/
public static $testViews = [
'test_serializer_display_entity',
];
/**
* {@inheritdoc}
*/
protected static $modules = [
'jsonapi',
'rest_test_views',
'views_ui',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp($import_test_views = TRUE, $modules = [
'rest_test_views',
]) : void {
parent::setUp($import_test_views, $modules);
$this->drupalLogin($this->drupalCreateUser([
'administer views',
]));
}
/**
* Tests that 'api_json' is not a RestExport format option.
*/
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.