Eva\EvaEngine\EvaEngineTest\Interceptor\DispatchTest::setUp PHP Method

setUp() public method

public setUp ( )
    public function setUp()
    {
        $di = new DI();
        $_SERVER['HTTP_HOST'] = 'example.com';
        $_SERVER['REQUEST_METHOD'] = 'GET';
        $_SERVER['REQUEST_URI'] = '/path?foo=aaa&bar=bbb';
        $_GET = array('_url' => '/path', 'foo' => 'aaa', 'bar' => 'bbb');
        $request = new Request();
        $request->setDI($di);
        $this->request = $request;
        $response = new Response();
        $response->setDI($di);
        $dispatcher = new Dispatcher();
        $dispatcher->setDI($di);
        $this->dispatcher = $dispatcher;
        $cache = new BackendCache(new FrontendCache());
        $di->set('viewCache', $cache);
        $config = new Config(array('cache' => array('enable' => true)));
        $di->set('config', $config);
        $eventsManager = new Manager();
        $cors = new Cors(array(array('domain' => 'bar.com')));
        $di->set('request', $request, true);
        $di->set('response', $response, true);
        $di->set('dispatcher', $dispatcher, true);
        $di->set('eventsManager', $eventsManager);
        $di->set('cors', $cors);
        $this->di = $di;
        $application = new Application();
        $application->setDI($di);
        $application->setEventsManager($eventsManager);
        $this->application = $application;
    }