* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class GroupTest extends TestCase { public function testGroup() { $request = new Request(new Url('http://localhost'), 'GET'); $response = new Response(); $subFilters[] = new DummyFilter(3); $subFilters[] = new DummyFilter(4); $filters[] = new DummyFilter(1); $filters[] = new DummyFilter(2); $filters[] = new Group($subFilters); $filters[] = new DummyFilter(5); $filters[] = new DummyFilter(6); $filterChain = new FilterChain($filters); $filterChain->handle($request, $response); $this->assertEquals(array(1, 2, 3, 4, 5, 6), DummyFilter::$calls); } } class DummyFilter implements FilterInterface { public static $calls = array(); protected $id; public function __construct($id) { $this->id = $id; } public function handle(RequestInterface $request, ResponseInterface $response, FilterChainInterface $filterChain) { self::$calls[] = $this->id; $filterChain->handle($request, $response); } } __halt_compiler();----SIGNATURE:----kLIbyBpe6WwpcFSytiuimHXUqqtaG7PsIg8VwH7vE9fBQpetN78ow+PLhVjliuuBjQ0Ztcjx6zsJfBep9PmhI8kLKLxmdOTp0l3suWbM7m9TV6drshSAVNceH05ojpi8C41sMtfBiQE0s00N7U45ua7K6QyBBYqgjERZIH95zScfgs1BNNSB6JllXc7WBqMu/SBPkUnDn1lBsAinQji6P6brA6k6eJ0JHipf1IqwvijHUf/r4Tl475g4wOfYlmTWsdYQq89zXU46N9NQJeag68wpX37qHcaKQETG2PuriOsrSsyPcmUXBZL/Xxn155Cf2ycBVQTzuho6Bu3lYqgwZYRWKYSERN9b2rJ4fce6n/buaPsCht62RIZV2RbeshLwEV8W9ojFK6bBsXzfjo4YP2NSs5Ua6tHfuH15J6ZM8Q7R+YCF+7rI7wIZZsjKAd2RT7eKHP5KYBUays/Wr1WXOU/q5gRVWIWmdrTDSNwFrTs49AJE5HNT4JVjuRzPDC8wu0EPIxThFwDHbC5LY3bwYAMxlkV7wXLEfaiEgSYxn7gHRIoLk//NjmDGGVxm1tNaMvG9ZWz/k0y4bGFrn2GiCQDRnWw/rXy8vvkRTqmYEefyXY9I9hOqme72FbhvDwN9S+bQ1HY0wSUcE0Q88uXSEKM4eMMBSNWhQfY+c08pFJ8=----ATTACHMENT:----OTMzOTE4NDgzMDAwODI1MCAyMzAwODA2ODI0Njg0OTA3IDUwMTI1MzE1ODMxNDI4MjA=