public function testCallsTestLayer()
 {
     $stack = new Stack();
     $expectedBody = 'test-resolve';
     $stack->employ(array('class' => 'Server\\TestStack', 'config' => array('body' => 'test-resolve')));
     $res = $stack->call();
     $this->assertEquals($res->body, 'test-resolve');
 }
Beispiel #2
0
 public function call(Request $req = null, Error $err = null)
 {
     $this->d('Module.call(' . ($req ? '`' . $req->method . ' ' . $this->config->get('uri', $req->uri) . '`' : 'NULL') . ')');
     switch ($this->state) {
         case static::STATE_IDLE:
             if (!$req) {
                 $req = $this->getCurrentRequest();
             }
             if ($app = $this->resolve($req)) {
                 return $app->call($req, $err);
             }
             return $this->getProcessedResponse($req, $err);
         case static::STATE_LOOP:
             return $this->getProcessedResponse($req, $err);
     }
     return parent::call($req, $err);
 }