Ejemplo n.º 1
0
 public function testGetLinkedProducts()
 {
     $typeInstance = $this->getMock('\\Magento\\GroupedProduct\\Model\\Product\\Type\\Grouped', [], [], '', false);
     $product = $this->getMock('\\Magento\\Catalog\\Model\\Product', [], [], '', false);
     $expected = [$product];
     $product->expects($this->once())->method('getTypeInstance')->will($this->returnValue($typeInstance));
     $typeInstance->expects($this->once())->method('getAssociatedProducts')->with($product)->will($this->returnValue($expected));
     $model = new Grouped();
     $this->assertEquals($expected, $model->getLinkedProducts($product));
 }
Ejemplo n.º 2
0
 /**
  * Ensure that same data is not saved again
  */
 public function testSaveToCacheNotDirty()
 {
     $this->cache->expects($this->never())->method('save');
     $this->cache->expects($this->once())->method('load')->with('type:file|area:frontend|theme:magento_theme|locale:en_US')->will($this->returnValue(json_encode(['module:Magento_Module|file:file.ext' => 'some/file.ext'])));
     $this->object->saveToCache('some/file.ext', 'file', 'file.ext', 'frontend', 'magento_theme', 'en_US', 'Magento_Module');
     $this->object = null;
 }