Skip to content

Commit 36faa70

Browse files
committed
MC-21685: View simple product on storefront
1 parent 6a18fd3 commit 36faa70

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ViewTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ViewTest extends TestCase
2929
private $objectManager;
3030

3131
/** @var View */
32-
private $_block;
32+
private $block;
3333

3434
/** @var ProductRepositoryInterface */
3535
private $productRepository;
@@ -49,7 +49,7 @@ class ViewTest extends TestCase
4949
protected function setUp()
5050
{
5151
$this->objectManager = Bootstrap::getObjectManager();
52-
$this->_block = $this->objectManager->create(View::class);
52+
$this->block = $this->objectManager->create(View::class);
5353
$this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
5454
$this->layout = $this->objectManager->get(LayoutInterface::class);
5555
$this->registry = $this->objectManager->get(Registry::class);
@@ -74,21 +74,21 @@ public function testGetProduct(): void
7474
$product = $this->productRepository->get('simple');
7575
$this->registerProduct($product);
7676

77-
$this->assertNotEmpty($this->_block->getProduct()->getId());
78-
$this->assertEquals($product->getId(), $this->_block->getProduct()->getId());
77+
$this->assertNotEmpty($this->block->getProduct()->getId());
78+
$this->assertEquals($product->getId(), $this->block->getProduct()->getId());
7979

8080
$this->registry->unregister('product');
81-
$this->_block->setProductId($product->getId());
81+
$this->block->setProductId($product->getId());
8282

83-
$this->assertEquals($product->getId(), $this->_block->getProduct()->getId());
83+
$this->assertEquals($product->getId(), $this->block->getProduct()->getId());
8484
}
8585

8686
/**
8787
* @return void
8888
*/
8989
public function testCanEmailToFriend(): void
9090
{
91-
$this->assertFalse($this->_block->canEmailToFriend());
91+
$this->assertFalse($this->block->canEmailToFriend());
9292
}
9393

9494
/**
@@ -97,7 +97,7 @@ public function testCanEmailToFriend(): void
9797
public function testGetAddToCartUrl(): void
9898
{
9999
$product = $this->productRepository->get('simple');
100-
$url = $this->_block->getAddToCartUrl($product);
100+
$url = $this->block->getAddToCartUrl($product);
101101

102102
$this->assertStringMatchesFormat(
103103
'%scheckout/cart/add/%sproduct/' . $product->getId() . '/',
@@ -112,7 +112,7 @@ public function testGetJsonConfig(): void
112112
{
113113
$product = $this->productRepository->get('simple');
114114
$this->registerProduct($product);
115-
$config = $this->json->unserialize($this->_block->getJsonConfig());
115+
$config = $this->json->unserialize($this->block->getJsonConfig());
116116

117117
$this->assertNotEmpty($config);
118118
$this->assertArrayHasKey('productId', $config);
@@ -127,7 +127,7 @@ public function testHasOptions(): void
127127
$product = $this->productRepository->get('simple');
128128
$this->registerProduct($product);
129129

130-
$this->assertTrue($this->_block->hasOptions());
130+
$this->assertTrue($this->block->hasOptions());
131131
}
132132

133133
/**
@@ -138,7 +138,7 @@ public function testHasRequiredOptions(): void
138138
$product = $this->productRepository->get('simple');
139139
$this->registerProduct($product);
140140

141-
$this->assertTrue($this->_block->hasRequiredOptions());
141+
$this->assertTrue($this->block->hasRequiredOptions());
142142
}
143143

144144
/**
@@ -148,7 +148,7 @@ public function testStartBundleCustomization(): void
148148
{
149149
$this->markTestSkipped("Functionality not implemented in Magento 1.x. Implemented in Magento 2");
150150

151-
$this->assertFalse($this->_block->startBundleCustomization());
151+
$this->assertFalse($this->block->startBundleCustomization());
152152
}
153153

154154
/**
@@ -160,8 +160,8 @@ public function testAddToCartBlockInvisibility(): void
160160
{
161161
$outOfStockProduct = $this->productRepository->get('simple-out-of-stock');
162162
$this->registerProduct($outOfStockProduct);
163-
$this->_block->setTemplate('Magento_Catalog::product/view/addtocart.phtml');
164-
$output = $this->_block->toHtml();
163+
$this->block->setTemplate('Magento_Catalog::product/view/addtocart.phtml');
164+
$output = $this->block->toHtml();
165165

166166
$this->assertNotContains((string)__('Add to Cart'), $output);
167167
}
@@ -173,8 +173,8 @@ public function testAddToCartBlockVisibility(): void
173173
{
174174
$product = $this->productRepository->get('simple');
175175
$this->registerProduct($product);
176-
$this->_block->setTemplate('Magento_Catalog::product/view/addtocart.phtml');
177-
$output = $this->_block->toHtml();
176+
$this->block->setTemplate('Magento_Catalog::product/view/addtocart.phtml');
177+
$output = $this->block->toHtml();
178178

179179
$this->assertContains((string)__('Add to Cart'), $output);
180180
}

dev/tests/integration/testsuite/Magento/Catalog/Controller/ProductTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*
2121
* @see \Magento\Catalog\Controller\Product
2222
*
23-
* @magentoAppIsolation enabled
2423
* @magentoDbIsolation enabled
2524
*/
2625
class ProductTest extends AbstractController

0 commit comments

Comments
 (0)