function dsExportablesTests::testDSExportablesCustomFields in Display Suite 7
Same name and namespace in other branches
- 7.2 tests/ds.exportables.test \dsExportablesTests::testDSExportablesCustomFields()
File
- tests/
ds.exportables.test, line 129 - Base functions and tests for Display Suite.
Class
- dsExportablesTests
- @file Base functions and tests for Display Suite.
Code
function testDSExportablesCustomFields() {
$this
->dsExportablesSetup();
// Look for default custom field.
$this
->drupalGet('admin/structure/ds/fields');
$this
->assertText('Exportable field');
$this
->drupalGet('admin/structure/types/manage/article/display');
$this
->assertText('Exportable field');
// Override custom field.
// Update testing label
$edit = array(
'name' => 'Overridden field',
);
$this
->drupalPost('admin/structure/ds/fields/manage_custom/ds_exportable_field', $edit, t('Save'));
$this
->assertText(t('The field Overridden field has been saved'), t('Default exportable field label updated'));
$this
->assertText('Overridden field');
$this
->assertNoText('Exportable field');
$this
->drupalGet('admin/structure/types/manage/article/display');
$this
->assertText('Overridden field');
$this
->assertNoText('Exportable field');
// Revert.
$edit = array();
$this
->drupalPost('admin/structure/ds/fields/revert/ds_exportable_field', $edit, t('Revert'));
$this
->assertText('The field Overridden field has been reverted', t('Field reverted'));
$this
->assertText('Exportable field');
$this
->drupalGet('admin/structure/types/manage/article/display');
$this
->assertNoText('Overridden field');
$this
->assertText('Exportable field');
}