You are here

public function StyleSerializerTest::testSerializerViewsUI in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rest/src/Tests/Views/StyleSerializerTest.php \Drupal\rest\Tests\Views\StyleSerializerTest::testSerializerViewsUI()

Tests the views interface for REST export displays.

File

core/modules/rest/src/Tests/Views/StyleSerializerTest.php, line 517
Contains \Drupal\rest\Tests\Views\StyleSerializerTest.

Class

StyleSerializerTest
Tests the serializer style plugin.

Namespace

Drupal\rest\Tests\Views

Code

public function testSerializerViewsUI() {
  $this
    ->drupalLogin($this->adminUser);

  // Click the "Update preview button".
  $this
    ->drupalPostForm('admin/structure/views/view/test_serializer_display_field/edit/rest_export_1', $edit = array(), t('Update preview'));
  $this
    ->assertResponse(200);

  // Check if we receive the expected result.
  $result = $this
    ->xpath('//div[@id="views-live-preview"]/pre');
  $this
    ->assertIdentical($this
    ->drupalGet('test/serialize/field'), (string) $result[0], 'The expected JSON preview output was found.');
}