/** * A basic functional test example. * * @return void * @group photo */ public function testPhoto() { $photo = new Photo(); $photo->setUrl('url/photos'); $photo->setMain(0); $this->assertEquals('url/photos', $photo->getUrl()); $this->assertEquals(0, $photo->getMain()); }
public function addPhoto(Photo $photo, $id) { $p = null; try { $p = DB::table('photos')->insert(['url' => $photo->getUrl(), 'main' => $photo->getMain(), 'accommodation_id' => $id]); } catch (QueryException $ex) { return $p; } return $p; }