Skip to content

Commit

Permalink
test if routeproxy handles redirect-routes in icehawk, #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Bruska committed Nov 21, 2016
1 parent 96c685c commit 3b7b599
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/Unit/IceHawkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace IceHawk\IceHawk\Tests\Unit\Defaults;

use IceHawk\IceHawk\Constants\HttpCode;
use IceHawk\IceHawk\Constants\HttpMethod;
use IceHawk\IceHawk\Defaults\IceHawkConfig;
use IceHawk\IceHawk\Defaults\IceHawkDelegate;
use IceHawk\IceHawk\Defaults\RequestInfo;
Expand All @@ -37,6 +38,7 @@
use IceHawk\IceHawk\Requests\WriteRequestInput;
use IceHawk\IceHawk\Routing\Patterns\Literal;
use IceHawk\IceHawk\Routing\ReadRoute;
use IceHawk\IceHawk\Routing\RouteRedirect;
use IceHawk\IceHawk\Routing\WriteRoute;
use IceHawk\IceHawk\Tests\Unit\Fixtures\Domain\Read\GetRequestHandler;
use IceHawk\IceHawk\Tests\Unit\Fixtures\Domain\Read\HeadRequestHandler;
Expand Down Expand Up @@ -143,7 +145,9 @@ function ()
$route = new ReadRoute( new Literal( '/test' ), $requestHandler );

$config->expects( $this->once() )->method( 'getRequestInfo' )->willReturn( $requestInfo );
$config->expects( $this->once() )->method( 'getRedirectRoutes' )->willReturn( [] );
$config->expects( $this->once() )->method( 'getRedirectRoutes' )->willReturn( [
new RouteRedirect( new Literal( '/look_for_this' ), '/finalDestination', HttpMethod::GET )
] );
$config->expects( $this->once() )->method( 'getReadRoutes' )->willReturn( [ $route ] );
$config->expects( $this->once() )->method( 'getEventSubscribers' )->willReturn( [] );

Expand Down

0 comments on commit 3b7b599

Please sign in to comment.