function RestJsonApiUnsupported::setUp

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

Overrides ResourceTestBase::setUp

File

core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php, line 67

Class

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

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this->config('system.logging')
    ->set('error_level', ERROR_REPORTING_HIDE)
    ->save();
  // Create a "Camelids" node type.
  NodeType::create([
    'name' => 'Camelids',
    'type' => 'camelids',
  ])->save();
  // Create a "Llama" node.
  $node = Node::create([
    'type' => 'camelids',
  ]);
  $node->setTitle('Llama')
    ->setOwnerId(0)
    ->setPublished()
    ->save();
}

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