You are here

public function RestExportNestedTest::testViewExport in REST Export Nested 8

Test rest export json is different from nested json.

File

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

Class

RestExportNestedTest
Tests views REST export nested.

Namespace

Drupal\Tests\rest_export_nested\Functional

Code

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