10 class DataTest extends \PHPUnit\Framework\TestCase
24 $this->config = $this->createMock(\
Magento\Catalog\Model\
ProductTypes\ConfigInterface::class);
25 $this->helper = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject(
26 \
Magento\Bundle\Helper\Data::class,
27 [
'config' => $this->config]
33 $configData = [
'allowed_selection_types' => [
'foo',
'bar',
'baz']];
34 $this->config->expects($this->once())->method(
'getType')->with(
'bundle')->will($this->returnValue(
$configData));
36 $this->assertEquals(
$configData[
'allowed_selection_types'], $this->helper->getAllowedSelectionTypes());
42 $this->config->expects($this->once())->method(
'getType')
43 ->with(\
Magento\Catalog\Model\Product\Type::TYPE_BUNDLE)
46 $this->assertEquals([], $this->helper->getAllowedSelectionTypes());
testGetAllowedSelectionTypes()
testGetAllowedSelectionTypesIfTypesIsNotSet()