コード例 #1
0
 public function testSetGetProduct()
 {
     $this->assertSame($this->_product, $this->_block->getProduct());
     $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product');
     $this->_block->setProduct($product);
     $this->assertSame($product, $this->_block->getProduct());
 }
コード例 #2
0
ファイル: OptionsTest.php プロジェクト: koliaGI/magento2
 /**
  * @magentoDataFixture Magento/Catalog/_files/product_simple.php
  */
 public function testSetGetProduct()
 {
     $this->assertSame($this->product, $this->block->getProduct());
     $product = $this->objectManager->create('Magento\\Catalog\\Model\\Product');
     $this->block->setProduct($product);
     $this->assertSame($product, $this->block->getProduct());
 }