/**
  * Test loading of collection with pagination request
  *
  * @test
  * @dataProvider dataProvider
  * @loadExpectation
  * @registry entity_attribute
  * @singleton integernet_attributeoptionpager/observer
  * @param int $requestPage
  * @param $requestPageSize
  * @param $configPageSize
  * @throws Mage_Core_Exception
  */
 public function loadCollection($requestPage, $requestPageSize, $configPageSize)
 {
     $this->_mockToolbar();
     $this->app()->getStore('admin')->setConfig(IntegerNet_AttributeOptionPager_Model_Pager::XML_PAGE_SIZE, $configPageSize);
     $this->_registerEntityAttribute();
     $this->_triggerPredispatchObserver($requestPage, $requestPageSize);
     $actualOptionValues = array_map(function ($value) {
         return $value['store0'];
     }, $this->_block->getOptionValues());
     $expectedOptionValues = $this->expected('page-%s-size-%d', $requestPage, $requestPageSize ?: $configPageSize)->getOptions();
     $this->assertEquals($expectedOptionValues, $actualOptionValues);
 }
Example #2
0
 public function getOptionValues()
 {
     $values = parent::getOptionValues();
     if ($values) {
         $images = $this->getAttributeObject()->getOptionImages();
         foreach ($values as $value) {
             if (isset($images[$value['id']])) {
                 $value->setImageInfo(array($images[$value['id']]));
             }
         }
     }
     return $values;
 }
Example #3
0
 public function getOptionValues()
 {
     $values = parent::getOptionValues();
     if ($values) {
         $attribute_id = $this->getAttributeObject()->getId();
         $options = Mage::getResourceModel('ecommerceteam_sln/attribute_collection')->addFieldToFilter('attribute_id', $attribute_id);
         foreach ($values as $value) {
             if ($data = $options->getItemByColumnValue('option_id', $value['id'])) {
                 $value->addData(array('url_key' => $data->getUrlKey(), 'image_info' => array(array('name' => $data->getImage()))));
             } else {
                 $value->addData(array('url_key' => '', 'image_info' => array(array('name' => ''))));
             }
         }
     }
     return $values;
 }
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('gec/catalog/product/attribute/options.phtml');
 }
Example #5
0
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('supplierfrontendproductuploader/catalog/product/attribute/options.phtml');
 }