Exemple #1
0
 /** @depends testCompile */
 public function testSetIfEmptyCached()
 {
     $route = new Router(file);
     $route->setCache(TestCacheClass::getInstance());
     $req = Request::create('/ifempty/algo?x=1', 'GET');
     $req->attributes->set('phpunit', $this);
     $out = $route->doRoute($req);
     $this->assertEquals('ALGO', $req->attributes->get('algo-alias'));
     $this->assertTrue($req->attributes->get('filter:cached:algo-alias'));
 }
Exemple #2
0
 /** @depends testCompile */
 public function testSetIfEmptyCached()
 {
     $route = new Route();
     $req = new Request();
     $req->set('phpunit', $this);
     $route->setCache(TestCacheClass::getInstance());
     $out = $route->doRoute($req, array('REQUEST_URI' => '/ifempty/algo'));
     $this->assertEquals('ALGO', $req->get('algo-alias'));
     $this->assertTrue($req->get('filter:cached:algo-alias'));
 }