Skip to content

Commit

Permalink
Merge pull request #3216 from mehdihasanpour/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
l0gicgate committed Jul 7, 2022
2 parents 484a32a + 1ce17b7 commit f640f63
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tests/CallableResolverTest.php
Expand Up @@ -53,9 +53,9 @@ public function testClosure(): void
$callableRoute = $resolver->resolveRoute($test);
$callableMiddleware = $resolver->resolveMiddleware($test);

$this->assertEquals(true, $callable());
$this->assertEquals(true, $callableRoute());
$this->assertEquals(true, $callableMiddleware());
$this->assertTrue($callable());
$this->assertTrue($callableRoute());
$this->assertTrue($callableMiddleware());
}

public function testClosureContainer(): void
Expand Down Expand Up @@ -90,9 +90,9 @@ public function testFunctionName(): void
$callableRoute = $resolver->resolveRoute(__NAMESPACE__ . '\testAdvancedCallable');
$callableMiddleware = $resolver->resolveMiddleware(__NAMESPACE__ . '\testAdvancedCallable');

$this->assertEquals(true, $callable());
$this->assertEquals(true, $callableRoute());
$this->assertEquals(true, $callableMiddleware());
$this->assertTrue($callable());
$this->assertTrue($callableRoute());
$this->assertTrue($callableMiddleware());
}

public function testObjMethodArray(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Middleware/OutputBufferingMiddlewareTest.php
Expand Up @@ -103,7 +103,7 @@ public function testPrepend()
public function testOutputBufferIsCleanedWhenThrowableIsCaught()
{
$responseFactory = $this->getResponseFactory();
$mw = (function ($request, $handler) use ($responseFactory) {
$mw = (function ($request, $handler) {
echo "Test";
$this->assertEquals('Test', ob_get_contents());
throw new Exception('Oops...');
Expand Down
2 changes: 1 addition & 1 deletion tests/Routing/DispatcherTest.php
Expand Up @@ -53,7 +53,7 @@ public function testRouteCacheFileCanBeDispatched()
});
$route->setName('foo');

$cacheFile = dirname(__FILE__) . '/' . uniqid((string) microtime(true));
$cacheFile = __DIR__ . '/' . uniqid((string) microtime(true));
$routeCollector->setCacheFile($cacheFile);

$method = new ReflectionMethod(Dispatcher::class, 'createDispatcher');
Expand Down
2 changes: 1 addition & 1 deletion tests/Routing/RouteResolverTest.php
Expand Up @@ -48,7 +48,7 @@ public function testComputeRoutingResults(string $method, string $uri, string $e
$dispatcherProphecy = $this->prophesize(DispatcherInterface::class);
$dispatcherProphecy
->dispatch(Argument::type('string'), Argument::type('string'))
->will(function ($args) use ($routingResultsProphecy, $method, $expectedUri) {
->will(function ($args) use ($routingResultsProphecy, $expectedUri) {
if ($args[1] !== $expectedUri) {
throw new Error(sprintf(
"URI transformation failed.\n Received: '%s'\n Expected: '%s'",
Expand Down

0 comments on commit f640f63

Please sign in to comment.