You are here

function dfpBaseTest::createTag in Doubleclick for Publishers (DFP) 7

Same name and namespace in other branches
  1. 7.2 tests/dfp.test \dfpBaseTest::createTag()

Creates a basic dfp ad tag.

11 calls to dfpBaseTest::createTag()
dfpAdCategoriesTest::testDisplayAdCategories in tests/dfp_ad_categories.test
dfpAdTestTest::testQueryString in tests/dfp_ads.test
dfpAdTestTest::testTestPage in tests/dfp_ads.test
dfpDisplayTagTest::testBackfill in tests/dfp_display_tag.test
dfpDisplayTagTest::testDisplayTag in tests/dfp_display_tag.test

... See full list

File

tests/dfp_base.test, line 69
Base test file for DFP module.

Class

dfpBaseTest
@file Base test file for DFP module.

Code

function createTag($edit = array()) {

  // Create a new tag.
  $edit += $this
    ->dfpBasicTagEditValues();
  $this
    ->drupalPost('admin/structure/dfp_ads/add', $edit, t('Save'));

  // Load the tag object.
  $tag = dfp_tag_load($edit['machinename']);
  $this
    ->assertTrue(is_object($tag) && ($tag->machinename = $edit['machinename']), 'The new tag was saved correctly.');

  // Display the new tag.
  $edit = array();
  $delta = 'dfp_' . (drupal_strlen($tag->machinename) >= 32 ? md5($tag->machinename) : $tag->machinename);
  $edit['blocks[' . $delta . '][region]'] = 'sidebar_first';
  $this
    ->drupalPost('admin/structure/block', $edit, t('Save blocks'));
  return $tag;
}