OrnoTest\ContainerTest::testStoresAndInvokesClosure PHP Method

testStoresAndInvokesClosure() public method

    public function testStoresAndInvokesClosure()
    {
        $c = new Container();
        $c->add('foo', function () {
            $foo = new \OrnoTest\Assets\Foo(new \OrnoTest\Assets\Bar(new \OrnoTest\Assets\Baz()));
            $foo->injectBaz(new \OrnoTest\Assets\Baz());
            return $foo;
        });
        $foo = $c->get('foo');
        $this->assertInstanceOf('OrnoTest\\Assets\\Foo', $foo);
        $this->assertInstanceOf('OrnoTest\\Assets\\Bar', $foo->bar);
        $this->assertInstanceOf('OrnoTest\\Assets\\Baz', $foo->baz);
    }
ContainerTest