public function testCanFormatAnImagesModelWithNoMetadataSet()
{
$image = $this->getMock('Imbo\\Model\\Image');
$image->expects($this->once())->method('getMetadata')->will($this->returnValue(null));
$image->expects($this->once())->method('getAddedDate')->will($this->returnValue(new DateTime()));
$image->expects($this->once())->method('getUpdatedDate')->will($this->returnValue(new DateTime()));
$images = [$image];
$model = $this->getMock('Imbo\\Model\\Images');
$model->expects($this->once())->method('getImages')->will($this->returnValue($images));
$json = $this->formatter->format($model);
$data = json_decode($json, true);
$this->assertCount(1, $data['images']);
$image = $data['images'][0];
$this->assertArrayNotHasKey('metadata', $image);
}