You are here

public function RestExportNestedTest::testViewExportNested in REST Export Nested 8

Test rest export nested json.

File

tests/src/Functional/RestExportNestedTest.php, line 71

Class

RestExportNestedTest
Tests views REST export nested.

Namespace

Drupal\Tests\rest_export_nested\Functional

Code

public function testViewExportNested() {
  $actual_json = $this
    ->drupalGet('nested-data', [
    'query' => [
      '_format' => 'json',
    ],
  ]);
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $expected = '[{"nothing":[{"title":"Article","body":"Body"}]}]';
  $this
    ->assertSame($actual_json, $expected);
}