Example #1
0
 /**
  * @Given /^the ("[^"]+" taxon) has(?:| also) an image "([^"]+)" with a code "([^"]+)"$/
  */
 public function theTaxonHasAnImageWithACode(TaxonInterface $taxon, $imagePath, $imageCode)
 {
     $filesPath = $this->getParameter('files_path');
     $taxonImage = $this->taxonImageFactory->createNew();
     $taxonImage->setFile(new UploadedFile($filesPath . $imagePath, basename($imagePath)));
     $taxonImage->setCode($imageCode);
     $this->imageUploader->upload($taxonImage);
     $taxon->addImage($taxonImage);
     $this->objectManager->flush($taxon);
 }