/** * Disable block output if banner turned off or PublisherId is miss * * @return string */ protected function _toHtml() { $publisherId = $this->_paypalConfig->getBmlPublisherId(); $display = $this->_paypalConfig->getBmlDisplay($this->_section); $position = $this->_paypalConfig->getBmlPosition($this->_section); if (!$publisherId || $display == 0 || $this->_position != $position) { return ''; } $this->setData('publisher_id', $publisherId); $this->setData('size', $this->_paypalConfig->getBmlSize($this->_section)); return parent::_toHtml(); }
/** * Disable block output if banner turned off or PublisherId is miss * * @return string */ protected function _toHtml() { if (!$this->_paypalConfig->isMethodAvailable(Config::METHOD_WPP_BML) && !$this->_paypalConfig->isMethodAvailable(Config::METHOD_WPP_PE_BML)) { return ''; } $publisherId = $this->_paypalConfig->getBmlPublisherId(); $display = $this->_paypalConfig->getBmlDisplay($this->_section); $position = $this->_paypalConfig->getBmlPosition($this->_section); if (!$publisherId || $display == 0 || $this->_position != $position) { return ''; } $this->setData('publisher_id', $publisherId); $this->setData('size', $this->_paypalConfig->getBmlSize($this->_section)); return parent::_toHtml(); }
/** * @dataProvider getBmlSizeDataProvider */ public function testGetBmlSize($section, $expected) { $this->_scopeConfig->expects($this->once())->method('getValue')->with('payment/' . Config::METHOD_WPP_BML . '/' . $section . '_size')->will($this->returnValue($expected)); $this->assertEquals($expected, $this->_model->getBmlSize($section)); }