/** * @covers Nodrew\Bundle\DfpBundle\Model\AdUnit::setSizes */ public function testWillAcceptAdUnitWithNullSize() { $unit = new AdUnit('path', null); $this->assertSame(null, $unit->getSizes()); }
/** * Get the control block for an individual ad. * * @return string */ protected function getAdControlBlock(AdUnit $unit) { $publisherId = trim($this->settings->getPublisherId(), '/'); $targets = $this->getTargetsBlock($unit->getTargets()); $sizes = $this->printSizes($unit->getSizes()); $divId = $unit->getDivId(); $path = $unit->getPath(); return <<<BLOCK <script type="text/javascript"> googletag.cmd.push(function() { googletag.defineSlot('/{$publisherId}/{$path}', {$sizes}, '{$divId}').addService(googletag.pubads()); googletag.pubads().enableSingleRequest(); googletag.enableServices();{$targets} }); </script> BLOCK; }