Redirect.php
<?php
namespace Liaison\Test\Compo\Redirect;
class Redirect extends \Taeluf\Tester {
public function testGoto(){
$_SERVER['REQUEST_URI'] = '/request/from/cli/';
$_SERVER['REQUEST_METHOD'] = 'GET';
$lia = new \Liaison();
$lia->addRoute($_SERVER['REQUEST_URI'],
function($route){
$lia=$route->package();
$lia->goto('/black-lives-matter/');
},
$lia
);
$response = $lia->getResponse();
var_export($response->headers);
return $this->compare(
[
[
'Location: /black-lives-matter/',
302,
],
],
$response->headers
);
}
}
Redirect::runAll();