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

testObjectInstantiation() public method

public testObjectInstantiation ( array $data, $expected )
$data array
    public function testObjectInstantiation(array $data, $expected)
    {
        try {
            $objects = $this->loader->loadData($data)->getObjects();
            if (null === $expected) {
                $this->fail('Expected exception to be thrown.');
            }
        } catch (InstantiationThrowable $exception) {
            if (null === $expected) {
                return;
            }
            throw $exception;
        }
        $this->assertCount(1, $objects);
        $this->assertEquals($expected, $objects['dummy']);
    }