config = $this->getMockForAbstractClass(ConfigInterface::class); $this->helper = (new ObjectManager($this))->getObject( Data::class, ['config' => $this->config] ); } public function testGetAllowedSelectionTypes() { $configData = ['allowed_selection_types' => ['foo', 'bar', 'baz']]; $this->config->expects($this->once())->method('getType')->with('bundle')->willReturn($configData); $this->assertEquals($configData['allowed_selection_types'], $this->helper->getAllowedSelectionTypes()); } public function testGetAllowedSelectionTypesIfTypesIsNotSet() { $configData = []; $this->config->expects($this->once())->method('getType') ->with(Type::TYPE_BUNDLE) ->willReturn($configData); $this->assertEquals([], $this->helper->getAllowedSelectionTypes()); } }