Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CartConfigurationTest.php
Go to the documentation of this file.
1 <?php
7 
8 class CartConfigurationTest extends \PHPUnit\Framework\TestCase
9 {
16  public function testIsProductConfigured($productType, $config, $expected)
17  {
18  $cartConfiguration = new \Magento\Catalog\Model\Product\CartConfiguration();
19  $productMock = $this->createMock(\Magento\Catalog\Model\Product::class);
20  $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue($productType));
21  $this->assertEquals($expected, $cartConfiguration->isProductConfigured($productMock, $config));
22  }
23 
28  {
29  return [
30  'simple' => ['simple', [], false],
31  'virtual' => ['virtual', ['options' => true], true],
32  'bundle' => ['bundle', ['bundle_option' => 'option1'], true],
33  'some_option_type' => ['some_option_type', [], false]
34  ];
35  }
36 }
$config
Definition: fraud_order.php:17