mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
Removed server property from Router options.
This commit is contained in:
parent
d863e8d68c
commit
6951d2d364
@ -14,6 +14,10 @@
|
||||
- [#110](https://github.com/hyperf-cloud/hyperf/pull/110) [#111](https://github.com/hyperf-cloud/hyperf/pull/111) Fixed Redis::select is not work expected.
|
||||
- [#131](https://github.com/hyperf-cloud/hyperf/pull/131) Fixed property middlewares not work in `Router::addGroup`.
|
||||
|
||||
# Removed
|
||||
|
||||
- [#131](https://github.com/hyperf-cloud/hyperf/pull/131) Removed `server` property from Router options.
|
||||
|
||||
# v1.0.3 - 2019-07-02
|
||||
|
||||
## Added
|
||||
|
@ -82,7 +82,7 @@ class DispatcherFactory
|
||||
|
||||
$parser = new Std();
|
||||
$generator = new DataGenerator();
|
||||
return $this->routers[$serverName] = new RouteCollector($parser, $generator);
|
||||
return $this->routers[$serverName] = new RouteCollector($parser, $generator, $serverName);
|
||||
}
|
||||
|
||||
protected function initAnnotationRoute(array $collector): void
|
||||
|
@ -81,4 +81,22 @@ class RouteCollectorTest extends TestCase
|
||||
$this->assertSame(['PostMiddleware'], $middle['http']['/']['POST']);
|
||||
$this->assertSame(['ApiGetMiddleware', 'ApiSelfGetMiddleware'], $middle['http']['/api/']['GET']);
|
||||
}
|
||||
|
||||
public function testAddGroupMiddlewareFromAnotherServer()
|
||||
{
|
||||
$parser = new Std();
|
||||
$generator = new DataGenerator();
|
||||
$collector = new RouteCollector($parser, $generator, 'test');
|
||||
|
||||
$collector->addGroup('/api', function ($collector) {
|
||||
$collector->get('/', 'Handler::ApiGet', [
|
||||
'middleware' => ['ApiSelfGetMiddleware'],
|
||||
]);
|
||||
}, [
|
||||
'middleware' => ['ApiGetMiddleware'],
|
||||
]);
|
||||
|
||||
$middle = MiddlewareManager::$container;
|
||||
$this->assertSame(['ApiGetMiddleware', 'ApiSelfGetMiddleware'], $middle['test']['/api/']['GET']);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user