public function testRegisterComponentUsingClosure() { $config = ['key' => 'value']; $this->app->register('sc', function () use($config) { $component = new SomeComponent(''); $component->config($config); return $component; }); $this->assertSame($config, $this->app->sc->getConfig()); }