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