Tests the raw output options for row field rendering.
public function testFieldRawOutput() {
$this
->drupalLogin($this->adminUser);
// Test the UI settings for adding field ID aliases.
$this
->drupalGet('admin/structure/views/view/test_serializer_display_field/edit/rest_export_1');
$row_options = 'admin/structure/views/nojs/display/test_serializer_display_field/rest_export_1/row_options';
$this
->assertLinkByHref($row_options);
// Test an empty string for an alias, this should not be used. This also
// tests that the form can be submitted with no aliases.
$this
->drupalPost($row_options, array(
'row_options[field_options][created][raw_output]' => '1',
), t('Apply'));
$this
->drupalPost(NULL, array(), t('Save'));
$view = views_get_view('test_serializer_display_field');
$view
->setDisplay('rest_export_1');
$this
->executeView($view);
// Just test the raw 'created' value against each row.
foreach ($this
->drupalGetJSON('test/serialize/field') as $index => $values) {
$this
->assertIdentical($values['created'], $view->result[$index]->views_test_data_created, 'Expected raw created value found.');
}
}