public function testObjectHydration(array $data, array $expected = null)
{
try {
$objects = $this->loader->loadData($data)->getObjects();
if (null === $expected) {
$this->fail('Expected exception to be thrown.');
}
} catch (HydrationThrowable $exception) {
if (null === $expected) {
return;
}
throw $exception;
}
$this->assertEquals(count($expected), count($objects));
$this->assertEquals($expected, $objects);
}