Пример #1
0
 /**
  * @magentoDataFixture Magento/CatalogUrlRewrite/_files/product_simple.php
  * @magentoAppIsolation enabled
  */
 public function testGetAddToCartUrl()
 {
     $product = $this->productRepository->get('simple');
     $url = $this->block->getAddToCartUrl($product);
     $this->assertStringEndsWith('?options=cart', $url);
     $this->assertStringMatchesFormat('%ssimple-product.html%s', $url);
 }
Пример #2
0
 /**
  * @magentoDataFixture Magento/CatalogUrlRewrite/_files/product_simple.php
  * @magentoAppIsolation enabled
  */
 public function testGetAddToCartUrl()
 {
     $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product');
     $product->load(1);
     $url = $this->_block->getAddToCartUrl($product);
     $this->assertStringEndsWith('?options=cart', $url);
     $this->assertStringMatchesFormat('%ssimple-product.html%s', $url);
 }
Пример #3
0
 public function testGetAddToCartUrl()
 {
     $url = $this->_block->getAddToCartUrl($this->_product);
     $this->assertStringEndsWith('?options=cart', $url);
     $this->assertStringMatchesFormat('%ssimple-product.html%s', $url);
 }