示例#1
0
 /**
  * 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;
 }
示例#2
0
 /**
  * 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;
 }
示例#3
0
 /**
  * @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));
 }