Elgg\RouterTest::createService PHP Method

createService() public method

public createService ( )
    function createService()
    {
        _elgg_services()->setValue('systemMessages', $this->system_messages);
        // we don't want system messages propagating across tests
        _elgg_services()->setValue('hooks', $this->hooks);
        _elgg_services()->setValue('request', $this->request);
        _elgg_services()->setValue('translator', $this->translator);
        _elgg_services()->setValue('router', new Router($this->hooks));
        $this->amd_config = _elgg_services()->amdConfig;
        $this->ajax = new Service($this->hooks, $this->system_messages, $this->input, $this->amd_config);
        _elgg_services()->setValue('ajax', $this->ajax);
        $transport = new \Elgg\Http\OutputBufferTransport();
        $this->response_factory = new ResponseFactory($this->request, $this->hooks, $this->ajax, $transport);
        _elgg_services()->setValue('responseFactory', $this->response_factory);
        elgg_register_page_handler('ajax', '_elgg_ajax_page_handler');
        _elgg_services()->views->autoregisterViews('', "{$this->viewsDir}/default", 'default');
        _elgg_services()->views->autoregisterViews('', "{$this->viewsDir}/json", 'json');
    }
RouterTest