Example #1
0
 public function testSetUsedProductAttributeIds()
 {
     $testConfigurable = $this->_getAttributeByCode('test_configurable');
     $this->assertEmpty($this->_product->getData('_cache_instance_configurable_attributes'));
     $this->_model->setUsedProductAttributeIds(array($testConfigurable->getId()), $this->_product);
     $attributes = $this->_product->getData('_cache_instance_configurable_attributes');
     $this->assertArrayHasKey(0, $attributes);
     $this->assertInstanceOf('Mage_Catalog_Model_Product_Type_Configurable_Attribute', $attributes[0]);
     $this->assertSame($testConfigurable, $attributes[0]->getProductAttribute());
 }