function it_returns_an_image_by_code(TaxonImageInterface $image) { $image->getCode()->willReturn('thumbnail'); $image->setTaxon($this)->shouldBeCalled(); $this->addImage($image); $this->getImageByCode('thumbnail')->shouldReturn($image); }
/** * {@inheritdoc} */ public function addImage(TaxonImageInterface $image) { $image->setTaxon($this); $this->images->add($image); }