-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
932c012
commit f5109d8
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* Slim Framework (http://slimframework.com) | ||
* | ||
* @link https://github.com/slimphp/Slim | ||
* @copyright Copyright (c) 2011-2016 Josh Lockhart | ||
* @license https://github.com/slimphp/Slim/blob/master/LICENSE.md (MIT License) | ||
*/ | ||
namespace Slim\Tests\Mocks; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Psr\Http\Message\ServerRequestInterface; | ||
use Slim\Interfaces\InvocationStrategyInterface; | ||
|
||
class InvocationStrategyTest implements InvocationStrategyInterface | ||
{ | ||
public static $LastCalledFor = null; | ||
|
||
/** | ||
* Invoke a route callable. | ||
* | ||
* @param callable $callable The callable to invoke using the strategy. | ||
* @param ServerRequestInterface $request The request object. | ||
* @param ResponseInterface $response The response object. | ||
* @param array $routeArguments The route's placholder arguments | ||
* | ||
* @return ResponseInterface|string The response from the callable. | ||
*/ | ||
public function __invoke( | ||
callable $callable, | ||
ServerRequestInterface $request, | ||
ResponseInterface $response, | ||
array $routeArguments | ||
) { | ||
static::$LastCalledFor = $callable; | ||
|
||
return $response; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters