config = $this->createMock(\Magento\Catalog\Model\ProductTypes\ConfigInterface::class); $this->helper = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject( \Magento\Bundle\Helper\Data::class, ['config' => $this->config] ); } public function testGetAllowedSelectionTypes() { $configData = ['allowed_selection_types' => ['foo', 'bar', 'baz']]; $this->config->expects($this->once())->method('getType')->with('bundle')->will($this->returnValue($configData)); $this->assertEquals($configData['allowed_selection_types'], $this->helper->getAllowedSelectionTypes()); } public function testGetAllowedSelectionTypesIfTypesIsNotSet() { $configData = []; $this->config->expects($this->once())->method('getType') ->with(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) ->will($this->returnValue($configData)); $this->assertEquals([], $this->helper->getAllowedSelectionTypes()); } }