/** * @covers Phossa\Route\Context\Result::setRoute * @covers Phossa\Route\Context\Result::getRoute */ public function testSetRoute() { $route = new Route(); $this->object->setRoute($route); $this->assertTrue($route === $this->object->getRoute()); }
/** * 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'); } }