You are here

protected function DfpTestBase::dfpBasicTagEditValues in Doubleclick for Publishers (DFP) 8

Creates a simple form values $edit array to be used to create a DFP tag.

Return value

array A simple $edit array to be used on the DFP tag form.

5 calls to DfpTestBase::dfpBasicTagEditValues()
DfpTestBase::dfpCreateTag in tests/src/Functional/DfpTestBase.php
Creates a basic dfp ad tag.
DisplayTagTest::testBackfill in tests/src/Functional/DisplayTagTest.php
Tests Adsense backfill settings.
DisplayTagTest::testDisplayTagWithMapping in tests/src/Functional/DisplayTagTest.php
Tests breakpoint mappings.
DisplayTagTest::testSlug in tests/src/Functional/DisplayTagTest.php
Tests slug display.
DisplayTagTest::testTargeting in tests/src/Functional/DisplayTagTest.php
Tests targeting display.

File

tests/src/Functional/DfpTestBase.php, line 118
Contains \Drupal\Tests\dfp\Functional\DfpTestBase.

Class

DfpTestBase
An abstract class to build DFP tests from.

Namespace

Drupal\Tests\dfp\Functional

Code

protected function dfpBasicTagEditValues() {
  $machineName = $this
    ->randomMachineName(16);
  $basicTag = [
    'id' => mb_strtolower($machineName),
    'slot' => $machineName,
    'size' => implode(',', $this
      ->dfpGenerateSize(2)),
    'adunit' => $this
      ->randomMachineName(),
    'block' => 1,
    'slug' => $this
      ->randomMachineName(32),
    'adsense_backfill[ad_types]' => '',
    'adsense_backfill[channel_ids]' => '',
    'adsense_backfill[color][background]' => '',
    'adsense_backfill[color][border]' => '',
    'adsense_backfill[color][link]' => '',
    'adsense_backfill[color][text]' => '',
    'adsense_backfill[color][url]' => '',
    'targeting[0][target]' => $this
      ->randomMachineName(8),
    'targeting[0][value]' => $this
      ->randomMachineName(8),
    'breakpoints[0][browser_size]' => $this
      ->dfpGenerateSize(),
    'breakpoints[0][ad_sizes]' => implode(',', $this
      ->dfpGenerateSize(2)),
  ];
  return $basicTag;
}