File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
app/code/Magento/ConfigurableProduct/Model/Product/Type
dev/tests/integration/testsuite/Magento/ConfigurableProduct Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -812,7 +812,7 @@ public function isSalable($product)
812
812
if (!is_null ($ product )) {
813
813
$ this ->setStoreFilter ($ product ->getStoreId (), $ product );
814
814
}
815
- $ salable = ( count ($ this ->getSalableUsedProducts ($ product )) > 0 ) ? true : false ;
815
+ $ salable = count ($ this ->getSalableUsedProducts ($ product )) > 0 ;
816
816
}
817
817
818
818
return $ salable ;
Original file line number Diff line number Diff line change 9
9
*/
10
10
namespace Magento \ConfigurableProduct \Controller ;
11
11
12
+ use Magento \TestFramework \Helper \Bootstrap ;
13
+ use Magento \Catalog \Api \ProductRepositoryInterface ;
14
+
12
15
class CartTest extends \Magento \TestFramework \TestCase \AbstractController
13
16
{
14
17
/**
@@ -21,7 +24,10 @@ public function testConfigureActionWithConfigurableProduct()
21
24
/** @var $session \Magento\Checkout\Model\Session */
22
25
$ session = $ this ->_objectManager ->create ('Magento\Checkout\Model\Session ' );
23
26
24
- $ quoteItem = $ this ->_getQuoteItemIdByProductId ($ session ->getQuote (), 1 );
27
+ $ productRepository = Bootstrap::getObjectManager ()->create (ProductRepositoryInterface::class);
28
+ $ product = $ productRepository ->get ('configurable ' );
29
+
30
+ $ quoteItem = $ this ->_getQuoteItemIdByProductId ($ session ->getQuote (), $ product ->getId ());
25
31
$ this ->assertNotNull ($ quoteItem , 'Cannot get quote item for configurable product ' );
26
32
27
33
$ this ->dispatch (
Original file line number Diff line number Diff line change 8
8
use Magento \TestFramework \Helper \Bootstrap ;
9
9
10
10
require 'product_configurable.php ' ;
11
+ /** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
11
12
12
13
$ productRepository = Bootstrap::getObjectManager ()
13
14
->create (ProductRepositoryInterface::class);
You can’t perform that action at this time.
0 commit comments