/**
  *
  */
 public function testGetServiceWithService()
 {
     $services = new Container();
     $application = new Application(new \ArrayObject(), new Request(), $services);
     $application->addService('service1', function () {
         return 'value1';
     });
     $this->assertSame('value1', $application->getService('service1'));
 }
Esempio n. 2
0
 /**
  * init the module.
  *
  * @param Application $application
  */
 public function init(Application $application)
 {
     $application->addService('staticController', new StaticControllerService());
     $application->any(':all', $application->getService('staticController'));
 }
Esempio n. 3
0
 /**
  * init the module.
  *
  * @param Application $application
  */
 public function init(Application $application)
 {
     $application->addService('template', new TemplateService([new TemplateExtension($application->getServices())]));
 }
Esempio n. 4
0
 /**
  * init the module.
  *
  * @param Application $application
  */
 public function init(Application $application)
 {
     $application->addService('session', new SessionService());
 }