public function testCRUD() { $vehicle = $this->setupVehicle(); $this->assertSame(1, $vehicle->getId()); $vehicle->setMPG(32); $this->assertSame(null, $vehicle->getUpdated()); $this->vehicleRepository->update($vehicle); $this->assertTrue($vehicle->getUpdated() instanceof \DateTime); $this->vehicleRepository->delete($vehicle); $this->assertSame(null, $vehicle->getId()); }
public function editVehicle(User $user, Vehicle &$vehicle) { $this->validateUser($user, $vehicle); $this->vehicleRepository->update($vehicle); }