Esempio n. 1
0
 /**
  * @test
  */
 public function photoNameCanBeInstantiated()
 {
     $photoId = new PhotoId();
     $alt = 'testing name';
     $altSlug = 'testing-name';
     $photoAlt = new PhotoAlt($photoId, $alt, new Lang(Lang::LANGUAGE_ES));
     $this->assertEquals($photoId->id(), $photoAlt->photoId());
     $this->assertEquals($alt, $photoAlt->name());
     $this->assertEquals($altSlug, $photoAlt->slug());
     $this->assertEquals(Lang::LANGUAGE_ES, $photoAlt->lang());
 }
 /**
  * @param PhotoId $photoId
  * @param PhotoAlt $alt
  */
 private function saveAlternativeText(PhotoId $photoId, PhotoAlt $alt)
 {
     $sentence = $this->pdo->prepare("INSERT INTO alternative_text(\"photo_uuid\", \"alt\", \"lang\") " . "VALUES(:photo_uuid, :alt, :lang)");
     $sentence->bindValue(':photo_uuid', $photoId->id());
     $sentence->bindValue(':alt', $alt->name());
     $sentence->bindValue(':lang', $alt->lang());
     $sentence->execute();
 }