public function testCanFormatAnImagesModelWithSomefields()
{
$image = $this->getMock('Imbo\\Model\\Image');
$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));
$fields = ['size', 'width', 'height'];
$model->expects($this->once())->method('getFields')->will($this->returnValue($fields));
$json = $this->formatter->format($model);
$data = json_decode($json, true);
$this->assertCount(1, $data['images']);
$image = $data['images'][0];
$this->assertArrayHasKey('size', $image);
$this->assertArrayHasKey('width', $image);
$this->assertArrayHasKey('height', $image);
$this->assertSameSize($fields, $image, 'Image array has to many keys');
}