Example #1
0
 public function testModules()
 {
     $this->specify("CLI Console doesn't work with modules", function () {
         $di = new Di();
         $di->set('data', function () {
             return "data";
         });
         $console = new Console();
         $console->setDI($di);
         $expected = ['devtools' => ['className' => 'dummy', 'path' => 'dummy_file']];
         $console->registerModules($expected);
         expect($console->getModules())->equals($expected);
         $userModules = ['front' => ['className' => 'front', 'path' => 'front_file'], 'worker' => ['className' => 'worker', 'path' => 'worker_file']];
         $expected = ['devtools' => ['className' => 'dummy', 'path' => 'dummy_file'], 'front' => ['className' => 'front', 'path' => 'front_file'], 'worker' => ['className' => 'worker', 'path' => 'worker_file']];
         $console->registerModules($userModules, true);
         expect($console->getModules())->equals($expected);
     });
 }