Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #3216

Merged
merged 5 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/CallableResolverTest.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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