ergo\tests\registry\RegistryTest::testRegisteringAClosureAsAFactory PHP Method

testRegisteringAClosureAsAFactory() public method

    public function testRegisteringAClosureAsAFactory()
    {
        $registry = new Registry();
        $registry->factory('my_key', function () {
            return (object) array('test' => 'blargh');
        });
        $this->assertTrue($registry->isRegistered('my_key'));
        $this->assertEquals($registry->lookup('my_key')->test, 'blargh');
    }