예제 #1
0
 /**
  * Initialize the application, load the modules.
  *
  * @param DependencyInjectionContainer $dic
  * @param array                        $config
  */
 public function __construct(DependencyInjectionContainer $dic, array $config)
 {
     $this->dic = $dic;
     /** @noinspection PhpInternalEntityUsedInspection */
     $loader = new ModuleLoader();
     $loader->loadModules($dic, $config);
 }
예제 #2
0
 /**
  * @covers Piccolo\Module\ModuleLoader
  */
 public function testLoadingNonModule()
 {
     //setup
     $moduleLoader = new ModuleLoader();
     $dic = new DependencyInjectionContainerMock();
     $config = ['modules' => [\stdClass::class]];
     //act
     //assert
     try {
         $moduleLoader->loadModules($dic, $config);
         $this->fail();
     } catch (ConfigurationException $e) {
         //pass
     }
 }