Exemple #1
0
 /**
  * @covers Phossa\Route\Context\Result::setStatus
  */
 public function testSetStatus()
 {
     $status = Status::MOVED_PERMANENTLY;
     $this->object->setStatus($status);
     $this->assertTrue($status === $this->object->getStatus());
 }
 /**
  * test not match, test GCB
  *
  * @covers Phossa\Route\Collector\Collector::match
  */
 public function testMatch61()
 {
     $this->object = new Collector(new ParserGcb(), ['chunk' => 3]);
     $this->object->addRoute(new Route('GET,POST', '/user[/{name:c}]'));
     $result = new Result(new Request('GET', '/user1/phossa'));
     if (!$this->invokeMethod('match', [$result])) {
         $this->assertEquals(Status::NOT_FOUND, $result->getStatus());
     } else {
         throw new \Exception('bad');
     }
 }