/** * Load modules from config */ protected function loadModules() { $this->modules = collect(); collect($this->config->modules())->each(function ($options, $name) { $this->modules->push(new Module($name, $this->app, $options)); }); }
protected function verifyValidPath($executionMethod, $configMethod) { $this->createModuleMock([]); if ($executionMethod == 'routesFilePath') { $this->module->shouldReceive('getPath')->once()->with($configMethod, '')->passthru(); } else { $this->module->shouldReceive('getPath')->once()->with($configMethod)->passthru(); } $this->config->shouldReceive($configMethod)->once()->with('')->andReturn('routing/file.php'); $this->module->shouldReceive('directory')->once()->withNoArgs()->andReturn('module/dir'); $this->module->shouldReceive('replace')->once()->with('routing/file.php', m::on(function ($arg) { return $arg instanceof Module && $arg->foo() == 'bar'; }))->andReturn('result'); $this->assertSame('module/dir' . DIRECTORY_SEPARATOR . 'result', $this->module->{$executionMethod}('')); }
/** * Get controller namespace for routing * * @return string */ public function routingControllerNamespace() { return $this->config->modulesNamespace() . '\\' . $this->name() . '\\' . $this->config->routingControllerNamespace(); }