示例#1
0
 /**
  * @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));
 }
示例#3
0
 /**
  * @return array
  */
 public function getBackordersOption()
 {
     if ($this->catalogData->isModuleEnabled('Magento_CatalogInventory')) {
         return $this->backorders->toOptionArray();
     }
     return array();
 }
示例#4
0
 /**
  * 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());
 }