function dfpAdCategoriesTest::testEnableDisableAdCategories in Doubleclick for Publishers (DFP) 7
Same name and namespace in other branches
- 7.2 tests/dfp.test \dfpAdCategoriesTest::testEnableDisableAdCategories()
File
- tests/dfp_ad_categories.test, line 20
- Ad Categories test file for DFP module.
Class
- dfpAdCategoriesTest
- @file
Ad Categories test file for DFP module.
Code
function testEnableDisableAdCategories() {
$edit = array(
'dfp_enable_ad_categories' => 1,
'dfp_enable_ad_categories_bundles[tags]' => 'tags',
);
$this
->drupalPost('admin/structure/dfp_ads/settings', $edit, t('Save configuration'));
$this
->drupalGet('admin/structure/taxonomy/tags/add');
$this
->assertFieldByName('field_dfp_ad_categories[und]');
$edit = array(
'dfp_enable_ad_categories' => 0,
);
$this
->drupalPost('admin/structure/dfp_ads/settings', $edit, t('Save configuration'));
$this
->drupalGet('admin/structure/taxonomy/tags/add');
$this
->assertNoFieldByName('field_dfp_ad_categories[und]');
$edit = array(
'dfp_enable_ad_categories' => 1,
'dfp_enable_ad_categories_bundles[tags]' => 'tags',
);
$this
->drupalPost('admin/structure/dfp_ads/settings', $edit, t('Save configuration'));
$this
->drupalGet('admin/structure/taxonomy/tags/add');
$edit = array(
'dfp_enable_ad_categories_bundles[tags]' => 0,
);
$this
->drupalPost('admin/structure/dfp_ads/settings', $edit, t('Save configuration'));
$this
->drupalGet('admin/structure/taxonomy/tags/add');
$this
->assertNoFieldByName('field_dfp_ad_categories[und]');
}