function testImport2() { $vehicleId = $this->findVehicleByLevelsMMY('Acura', 'Integra', '1986')->getId(); $mapper = new Elite_Vafpaint_Model_Paint_Mapper(); $actual = $mapper->findByVehicleId($vehicleId); $actual = $actual[1]; $this->assertEquals('B-38', $actual->getCode()); $this->assertEquals('Capitol Blue', $actual->getName()); $this->assertEquals('#061D72', $actual->getColor()); }
function ensureCompatible($slaveVehicles, $masterVehicle) { $paintMapper = new Elite_Vafpaint_Model_Paint_Mapper(); $paints = $paintMapper->findByVehicleId($masterVehicle->getId()); if (count($paints)) { throw new Elite_Vaf_Model_Merge_Exception_IncompatibleVehicleAttribute('vehicles have paint codes'); } foreach ($slaveVehicles as $slaveVehicle) { $paints = $paintMapper->findByVehicleId($slaveVehicle->getId()); if (count($paints)) { throw new Elite_Vaf_Model_Merge_Exception_IncompatibleVehicleAttribute('vehicles have paint codes'); } } }