/** * @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); }
/** * @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); }
public function testGetAddToCartUrl() { $url = $this->_block->getAddToCartUrl($this->_product); $this->assertStringEndsWith('?options=cart', $url); $this->assertStringMatchesFormat('%ssimple-product.html%s', $url); }