function dfpDisplayTagTest::testSlug in Doubleclick for Publishers (DFP) 7        
                          
                  
                        Same name and namespace in other branches
- 7.2 tests/dfp.test \dfpDisplayTagTest::testSlug()
File
 
   - tests/dfp_display_tag.test, line 81
- Display tag test file for DFP module.
Class
  
  - dfpDisplayTagTest 
- @file
Display tag test file for DFP module.
Code
function testSlug() {
  $edit = $this
    ->dfpBasicTagEditValues();
  
  variable_set('dfp_default_slug', '<p>Global slug</p>');
  $edit['settings[slug]'] = '';
  $tag = $this
    ->createTag($edit);
  $this
    ->assertRaw('<div class="slug">' . check_plain(variable_get('dfp_default_slug', '')) . '</div>', 'The default slug is correctly used when no slug exists for an individual tag.');
  
  $edit['settings[slug]'] = '<none>';
  $this
    ->editTag($tag->machinename, $edit);
  $this
    ->assertNoRaw('<div class="slug">', t('No slug is appearing when "@none" is used.', array(
    '@none' => '<none>',
  )));
  
  $slug = '<p>Custom slug</p>';
  $edit['settings[slug]'] = $slug;
  $this
    ->editTag($tag->machinename, $edit);
  $this
    ->assertRaw('<div class="slug">' . check_plain($slug) . '</div>', 'The provided slug is correctly displayed with its tag.');
}