Skip to content

Commit

Permalink
increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
orbeji committed Jan 19, 2024
1 parent 9850e48 commit 4f78366
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/EventSubscriber/LogRoutesSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ protected function setUp(): void
$this->provider = new FileUsageRouterProvider($this->filePath, 'usedRoutes.txt');
}

public function testOnControllerNooute()
{
$subscriber = new LogRoutesSubscriber($this->provider);
$request = $this->createStub(Request::class);
$route = null;
$request->method('get')->willReturn($route);
$controllerEvent = new ControllerEvent(
$this->createStub(HttpKernelInterface::class),
function(){},
$request,
1
);
$subscriber->onController($controllerEvent);

$routes = $this->provider->getRoutesUsage();

$this->assertCount(0, $routes);
}

public function testOnControllerValidRoute()
{
$subscriber = new LogRoutesSubscriber($this->provider);
Expand Down

0 comments on commit 4f78366

Please sign in to comment.