diff --git a/src/entity/image/UrlImage.php b/src/entity/image/UrlImage.php index 95f8d3e..0f8fe0d 100644 --- a/src/entity/image/UrlImage.php +++ b/src/entity/image/UrlImage.php @@ -2,20 +2,34 @@ namespace entity\image; /** - * + * This class represents an image which is just accessible via url + * In a real application you would upload the images to the server * @author kevinfrantz * */ -class UrlImage implements ImageInterface +final class UrlImage implements ImageInterface { + private $path; + + /** + * This is just a dummy function. + * In a real application you would return here a smaller scaled image + * {@inheritDoc} + * @see \entity\image\ImageInterface::getImageThumbnail() + */ public function getImageThumbnail(): string - {} + { + return $this->path; + } public function getImage(): string - {} + { + return $this->path; + } public function setImage(string $path): void - {} - + { + $this->path = $path; + } } diff --git a/src/entity/image/UrlImageTest.php b/src/entity/image/UrlImageTest.php new file mode 100644 index 0000000..48e83af --- /dev/null +++ b/src/entity/image/UrlImageTest.php @@ -0,0 +1,33 @@ +urlImage = new UrlImage(); + $this->urlImage->setImage(self::IMAGE_URL); + } + + public function testImage():void{ + $this->assertEquals(self::IMAGE_URL, $this->urlImage->getImage()); + } + + public function testThumbnail():void{ + $this->assertEquals(self::IMAGE_URL, $this->urlImage->getImageThumbnail()); + } +} +