/** * @return array */ public function getBackordersOption() { if ($this->moduleManager->isEnabled('Magento_CatalogInventory')) { return $this->backorders->toOptionArray(); } return []; }
/** * Run test getBackordersOption method * * @param bool $moduleEnabled * @return void * * @dataProvider dataProviderModuleEnabled */ public function testGetBackordersOption($moduleEnabled) { $this->moduleManager->expects($this->once())->method('isEnabled')->with('Magento_CatalogInventory')->will($this->returnValue($moduleEnabled)); if ($moduleEnabled) { $this->backordersMock->expects($this->once())->method('toOptionArray')->will($this->returnValue(['test-value', 'test-value'])); } $result = $this->inventory->getBackordersOption(); $this->assertEquals($moduleEnabled, !empty($result)); }
/** * @return array */ public function getBackordersOption() { if ($this->catalogData->isModuleEnabled('Magento_CatalogInventory')) { return $this->backorders->toOptionArray(); } return array(); }
/** * Retrieve Backorders Options * * @return array */ public function getBackordersOption() { return $this->_backorders->toOptionArray(); }
/** * Run test getBackordersOption method * * @return void */ public function testGetBackordersOption() { $this->backordersMock->expects($this->once())->method('toOptionArray')->will($this->returnValue('return-value')); $this->assertEquals('return-value', $this->inventory->getBackordersOption()); }