Nelmio\Alice\Loader\LoaderIntegrationTest::testObjectHydration PHP Method

testObjectHydration() public method

public testObjectHydration ( array $data, array $expected = null )
$data array
$expected array
    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);
    }