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'); }