/** * Returns array to be used in multiselect on back-end * * @return array */ public function toOptionArray() { $configData = $this->carrierConfig->getCode($this->_code); $arr = array(); foreach ($configData as $code => $title) { $arr[] = array('value' => $code, 'label' => __($title)); } return $arr; }
/** * Get Container Types, that could be customized for UPS carrier * * @return array */ public function getCustomizableContainerTypes() { $result = []; $containerTypes = $this->configHelper->getCode('container'); foreach (parent::getCustomizableContainerTypes() as $containerType) { $result[$containerType] = $containerTypes[$containerType]; } return $result; }
/** * @param mixed $result * @param null|string $type * @param string $code * @dataProvider getCodeDataProvider */ public function testGetData($result, $type = null, $code = null) { $this->assertEquals($result, $this->helper->getCode($type, $code)); }