Skip to content

Commit

Permalink
Remove deprecated phpunit method call getObjectAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
samizdam committed Mar 13, 2020
1 parent 3dbbd8b commit a568eea
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ public function testCollectionThrowsExceptionWhenAttemptingToGetNamedRouteThatDo
*/
public function testNewPatternMatchesCanBeAddedAtRuntime(): void
{
$router = new Router;
$router = new class extends Router {
public function getPatternMatchers(): array
{
return $this->patternMatchers;
}
};
$router->addPatternMatcher('mockMatcher', '[a-zA-Z]');
$matchers = $this->getObjectAttribute($router, 'patternMatchers');
$matchers = $router->getPatternMatchers();

$this->assertArrayHasKey('/{(.+?):mockMatcher}/', $matchers);
$this->assertEquals('{$1:[a-zA-Z]}', $matchers['/{(.+?):mockMatcher}/']);
Expand Down

0 comments on commit a568eea

Please sign in to comment.