Closed F1Red5 closed 2 days ago
I don't get this:
test eav:attribute:view creditmemo crazyCoolAttribute and eav:attribute:remove creditmemo crazyCoolAttribute
How to test the above?
I guess it's n98-magerun eav:attribute:view creditmemo crazyCoolAttribute
magerun build doesn't work on mac and I can't find any doc, I'll blindly review this PR
Description (*)
Issue 1:
array_keys(null)
fixed arround line 573.Issue 2: undifiened method
getDefaultAttributes()
for invoice, creditmemo, ... fixed arround line 372Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
n98/magerun:dev-develop
(v3.0.0)Test script
```php 'text', 'input' => 'text', 'label' => 'Test Attribute']; foreach (self::entityTypeProvider() as $entityType) { $this->createAttribute(array_values($entityType)[0], $attributeCode, $data); } } /** * From N98-magerun unit test */ public static function entityTypeProvider() { return [['catalog_category'], ['catalog_product'], ['creditmemo'], ['customer'], ['customer_address'], ['invoice'], ['order'], ['shipment']]; } /** * From N98-magerun unit test * * @param string $entityType * @param string $attributeCode * @param array $data */ protected function createAttribute($entityType, $attributeCode, $data) { $setup = Mage::getModel('eav/entity_setup', 'core_setup'); $setup->addAttribute($entityType, $attributeCode, $data); } } $test = new Test4034(); $test->prepare(); ```eav:attribute:view creditmemo crazyCoolAttribute
andeav:attribute:remove creditmemo crazyCoolAttribute
Questions or comments
After adding/removing EAV cache has to be cleaned, but this should be done in N98-magerun. (???) Not sure if it fixes all errors in unit tests, but these two issues should be easy to reproduce.
Todo: add
Mage::app()->getCacheInstance()->cleanType('eav');