Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 70a6f50

Browse files
committed
Merge branch 'hotfix/564-test-path-argument' into release-3.0.0
Close #564
2 parents 7402269 + b5dd7ee commit 70a6f50

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/ApplicationTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Psr\Http\Message\ServerRequestInterface;
1717
use Psr\Http\Server\MiddlewareInterface;
1818
use Psr\Http\Server\RequestHandlerInterface;
19+
use TypeError;
1920
use Zend\Expressive\Application;
2021
use Zend\Expressive\MiddlewareFactory;
2122
use Zend\Expressive\Router\Middleware\PathBasedRoutingMiddleware as RouteMiddleware;
@@ -128,6 +129,17 @@ public function testPipeCanAcceptAPathArgument($middleware)
128129
$this->assertNull($this->app->pipe('/foo', $middleware));
129130
}
130131

132+
public function testPipeNonSlashPathOnNonStringPipeProduceTypeError()
133+
{
134+
$middleware1 = function ($request, $response) {
135+
return $response;
136+
};
137+
$middleware2 = $this->createMockMiddleware();
138+
139+
$this->expectException(TypeError::class);
140+
$this->app->pipe($middleware1, $middleware2);
141+
}
142+
131143
/**
132144
* @dataProvider validMiddleware
133145
* @param string|array|callable|MiddlewareInterface $middleware

0 commit comments

Comments
 (0)