public function map($name, $callback)
{
if (method_exists($this, $name)) {
throw new \Exception('Cannot override an existing framework method.');
}
$this->dispatcher->set($name, $callback);
}
function testMapOverridesRegister() { $this->app->register('reg5', 'User'); $user = $this->app->reg5(); $this->assertTrue(is_object($user)); $this->app->map('reg5', function () { return 123; }); $user = $this->app->reg5(); $this->assertEquals(123, $user); }