Contao\CoreBundle\Test\Framework\ContaoFrameworkTest::testCreateInstanceSingelton PHP Method

testCreateInstanceSingelton() public method

Tests the createInstance method for a singleton class.
    public function testCreateInstanceSingelton()
    {
        $reflection = new \ReflectionClass('Contao\\CoreBundle\\Framework\\ContaoFramework');
        $framework = $reflection->newInstanceWithoutConstructor();
        $class = 'Contao\\CoreBundle\\Test\\Fixtures\\Adapter\\LegacySingletonClass';
        $instance = $framework->createInstance($class, [1, 2]);
        $this->assertInstanceOf($class, $instance);
        $this->assertEquals([1, 2], $instance->constructorArgs);
    }