Example #1
0
 public function testResolveBasedOnUriPath()
 {
     $stack = new Stack();
     $stack->employ(array('pattern' => '/foo*', 'class' => 'Server\\TestStack', 'config' => array('body' => 'foo')));
     $stack->employ(array('pattern' => '/bar*', 'class' => 'Server\\TestStack', 'config' => array('body' => 'bar')));
     $req = new Request('GET', '/foo');
     $app = $stack->resolve($req);
     $res = $app->call($req);
     $this->assertEquals('foo', $res->body);
 }