Esempio n. 1
0
 public function testAutoload()
 {
     $di = DI::getDefault();
     $di->set('environment', function () {
         return Constants::DEV_ENV;
     }, true);
     $serviceProviderLoader = new ServiceProviderLoader(DI::getDefault());
     $serviceProviderLoader->autoload(TESTS_ROOT_DIR . '/fixtures/app/services/', TESTS_ROOT_DIR . '/fixtures/app/config/');
     $this->assertTrue($di->has('url'));
     $this->assertTrue($di->has('assets'));
     $this->assertFalse($di->has('acl'));
 }
Esempio n. 2
0
 /**
  * Initializes services
  */
 public function initServices(Config $config)
 {
     $serviceProviderLoader = new ServiceProviderLoader($this->getDI());
     $serviceProviderLoader->autoload($config->application->serviceDir, $config->application->configDir);
 }