Skip to content
Snippets Groups Projects
Commit e40e5509 authored by Kevin Kaland's avatar Kevin Kaland
Browse files

Fix ImageFieldMapping.

parent 056ccf7a
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,8 @@ class ImageFieldMapping extends FieldMapping {
if (!in_array($extension, ['jpg', 'png', 'gif'])) {
throw new \InvalidArgumentException('Extension must be one of: jpg, png, gif.');
}
$this->extension = $extension;
}
/**
......
......@@ -20,4 +20,9 @@ class ImageFieldMappingTest extends UnitTestCase {
new ImageFieldMapping('Dummy image', 'bmp');
}
public function testGetExtension() {
$image_field_mapping = new ImageFieldMapping('Dummy image', 'jpg');
self::assertEquals('jpg', $image_field_mapping->getExtension());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment