Skip to content

Commit

Permalink
Fix test for deprecated feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGigi committed Aug 29, 2023
1 parent 089426f commit 6ca04e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"psr/log": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^9.6"
}
}
12 changes: 11 additions & 1 deletion tests/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Berlioz\Router\Attribute;
use Berlioz\Router\Exception\RoutingException;
use Berlioz\Router\Route;
use Exception;

class RouteTest extends AbstractTestCase
{
Expand Down Expand Up @@ -251,10 +252,19 @@ public function testTestRouteWithRequirementsInPath()

public function testTestRouteWithRequirementsInPath_deprecated()
{
$this->expectDeprecation();
set_error_handler(
function (int $errno, string $errstr) {
throw new Exception($errstr, $errno);
},
E_USER_DEPRECATED
);

$this->expectExceptionCode(E_USER_DEPRECATED);

$route = new Route('/my-path/{foo::uuid}');
$this->assertTrue($route->test($this->getServerRequest('/my-path/8bd71855-5e84-4a0e-9595-98a5f180840d')));

restore_error_handler();
}

public function testTestWithAttributes()
Expand Down

0 comments on commit 6ca04e6

Please sign in to comment.