Easier way to create a mock request for tests

This commit is contained in:
Pierre Rudloff 2017-01-16 12:21:38 +01:00
parent 7b48dbfd94
commit 929123c08e

View file

@ -43,13 +43,13 @@ class UglyRouterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals( $this->assertEquals(
[1, 'route0', []], [1, 'route0', []],
$this->router->dispatch( $this->router->dispatch(
new Request( Request::createFromEnvironment(
'GET', Environment::mock(
Uri::createFromString('http://example.com/?page=foo'), [
Headers::createFromEnvironment(new Environment()), 'REQUEST_METHOD' => 'GET',
[], 'QUERY_STRING'=>'page=foo'
[], ]
new Stream(fopen('php://temp', 'r')) )
) )
) )
); );