Example #1
0
 /** @todo get working */
 function testDeleteProductShouldDeleteFits()
 {
     return $this->markTestIncomplete();
     $observer = new Elite_Vaf_Model_Observer();
     $product = new Elite_Vaf_Model_Catalog_Product();
     $this->assertEquals('Elite_Vaf_Model_Catalog_Product', get_class($product));
     $event = new Elite_Vaf_Model_Observer_eventStub();
     $event->object = $product;
     $observer->deleteModelBefore($event);
 }
 function testShouldNotDeleteFitmentsForCategory()
 {
     $category = new Mage_Category_Model();
     $category->setId(1);
     $product = $this->product();
     $product->setId(1);
     $vehicle = $this->createVehicle(array('make' => 'Honda', 'model' => 'Civic', 'year' => 2000));
     $product->addVafFit($vehicle->toValueArray());
     $observer = new Elite_Vaf_Model_Observer();
     $event = new stdClass();
     $event->object = $category;
     $observer->deleteModelBefore($event);
     $this->assertEquals(1, count($product->getFits()), 'should have 1 fitments after callback for category deletion');
 }