Ejemplo n.º 1
0
 public function testGetPdfInitRenderer()
 {
     $this->_pdfConfigMock->expects($this->once())->method('getRenderersPerProduct')->with('invoice')->will($this->returnValue(['product_type_one' => 'Renderer_Type_One_Product_One', 'product_type_two' => 'Renderer_Type_One_Product_Two']));
     $this->_model->getPdf([]);
     $renderers = new \ReflectionProperty($this->_model, '_renderers');
     $renderers->setAccessible(true);
     $this->assertSame(['product_type_one' => ['model' => 'Renderer_Type_One_Product_One', 'renderer' => null], 'product_type_two' => ['model' => 'Renderer_Type_One_Product_Two', 'renderer' => null]], $renderers->getValue($this->_model));
 }
Ejemplo n.º 2
0
 /**
  * Initialize renderer process
  *
  * @param string $type
  * @return void
  */
 protected function _initRenderer($type)
 {
     $rendererData = $this->_pdfConfig->getRenderersPerProduct($type);
     foreach ($rendererData as $productType => $renderer) {
         $this->_renderers[$productType] = ['model' => $renderer, 'renderer' => null];
     }
 }
Ejemplo n.º 3
0
 public function testGetTotals()
 {
     $configuration = ['total1' => ['title' => 'Title1'], 'total2' => ['title' => 'Title2']];
     $this->_dataStorage->expects($this->once())->method('get')->with('totals', [])->will($this->returnValue($configuration));
     $this->assertSame($configuration, $this->_model->getTotals());
 }