You are here

function dfpDisplayTagTest::testBackfill in Doubleclick for Publishers (DFP) 7

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

File

tests/dfp_display_tag.test, line 153
Display tag test file for DFP module.

Class

dfpDisplayTagTest
@file Display tag test file for DFP module.

Code

function testBackfill() {
  $edit = $this
    ->dfpBasicTagEditValues();

  // Create a tag with backfill settings.
  $colors = array(
    'background',
    'border',
    'link',
    'text',
    'url',
  );
  $types = array(
    'text',
    'image',
    'text_image',
  );
  shuffle($types);
  $edit['settings[adsense_ad_types]'] = array_pop($types);
  $edit['settings[adsense_channel_ids]'] = $this
    ->randomName(8);
  foreach ($colors as $color) {
    $edit['settings[adsense_colors][' . $color . ']'] = drupal_strtoupper($this
      ->randomName(8));
  }
  $tag = $this
    ->createTag($edit);
  $this
    ->assertPropertySet('', 'adsense_ad_types', $edit['settings[adsense_ad_types]']);
  $this
    ->assertPropertySet('', 'adsense_channel_ids', $edit['settings[adsense_channel_ids]']);
  foreach ($colors as $color) {
    $this
      ->assertPropertySet('', 'adsense_' . $color . '_color', $edit['settings[adsense_colors][' . $color . ']']);
  }
}