Beispiel #1
0
 /**
  * Test that Router implements IteratorAggregate interface
  */
 public function testRouterImplementsIteratorAggregate()
 {
     $router = new Slim_Router($this->req, $this->res);
     $router->map('/bar', function () {
     })->via('GET');
     $router->map('/foo1', function () {
     })->via('POST');
     $router->map('/bar', function () {
     })->via('PUT');
     $router->map('/foo/bar/xyz', function () {
     })->via('DELETE');
     $iterator = $router->getIterator();
     $this->assertInstanceOf('ArrayIterator', $iterator);
     $this->assertEquals(2, $iterator->count());
 }