Ejemplo n.º 1
0
 public function testGetTypesByPriority()
 {
     $types = Mage_Catalog_Model_Product_Type::getTypesByPriority();
     // collect the types and priority in the same order as the method returns
     $result = array();
     foreach ($types as $typeId => $type) {
         if (!isset($type['index_priority'])) {
             // possible bug: index_priority is not defined for each type
             $priority = 0;
         } else {
             $priority = (int) $type['index_priority'];
         }
         // non-composite must be before composite
         if (1 != $type['composite']) {
             $priority = -1 * $priority;
         }
         $result[$typeId] = $priority;
     }
     $expectedResult = $result;
     asort($expectedResult);
     $this->assertEquals($expectedResult, $result);
 }