Skip to content

Commit

Permalink
Changed: Updated CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
merloxx committed Feb 9, 2024
1 parent 03e91e5 commit 442673c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file,
in reverse chronological order by release.

## [v1.2.1](https://github.com/zaphyr-org/router/compare/1.2.0...1.2.1) [2024-02-09]

### Fixed:

* The `getRoutes` method of the Router class now also takes group routes into account
* Route condition attributes now correctly overwrite group condition attributes

## [v1.2.0](https://github.com/zaphyr-org/router/compare/1.1.2...1.2.0) [2024-02-08]

### New:
Expand Down
16 changes: 16 additions & 0 deletions tests/Integration/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,22 @@ public function testHandleWildcardParamsRoute(): void
self::assertSame('{"bar":"bar"}', (string)$response->getBody());
}


public function testHandleWithMultipleWildcardParamsRoute(): void
{
$this->router->get('/and/{foo}/and/{bar:alpha}/and/{baz:alpha}', function ($request, $params) {
$response = new Response();
$response->getBody()->write(json_encode($params));

return $response;
});

$response = $this->router->handle(new ServerRequest(uri: '/and/foo/and/bar/and/baz'));

self::assertSame(200, $response->getStatusCode());
self::assertSame('{"foo":"foo","bar":"bar","baz":"baz"}', (string)$response->getBody());
}

public function testHandleWildcardParamsRouteThrowsNotFoundOnInvalidRoute(): void
{
$this->expectException(NotFoundException::class);
Expand Down

0 comments on commit 442673c

Please sign in to comment.