You've already forked Traefik-Redis-Api
Is there an award for this?
This commit is contained in:
@@ -48,7 +48,7 @@ class MiddlewareServiceTest extends Unit
|
||||
'/middlewares/foo/headers/customrequestheaders/X-Forwarded-Proto',
|
||||
]]);
|
||||
|
||||
$services = RedisClient::getAllMiddlewares($protocolEnum);
|
||||
$services = new RedisClient()->getAllMiddlewares($protocolEnum);
|
||||
$this->assertCount(1, $services);
|
||||
$this->assertSame('foo', $services[0]);
|
||||
}
|
||||
@@ -101,7 +101,7 @@ class MiddlewareServiceTest extends Unit
|
||||
'/middlewares/foo/headers/customrequestheaders/X-Forwarded-Proto')
|
||||
->andReturn('http');
|
||||
|
||||
$middleware = RedisClient::getMiddleware('foo', $protocolEnum);
|
||||
$middleware = new RedisClient()->getMiddleware('foo', $protocolEnum);
|
||||
|
||||
$this->assertCount(4, $middleware['headers']['customrequestheaders']);
|
||||
$this->assertSame('foo.localhost', $middleware['headers']['customrequestheaders']['Host']);
|
||||
|
||||
@@ -44,7 +44,7 @@ class RedisClientRoutersTest extends Unit
|
||||
->once()
|
||||
->andReturn(true);
|
||||
|
||||
RedisClient::createOrReplace('foo', [
|
||||
new RedisClient()->createOrReplace('foo', [
|
||||
'rule' => 'Host(`foo.localhost`)',
|
||||
'service' => 'foo',
|
||||
], EntityEnum::ROUTER, $protocol);
|
||||
@@ -108,7 +108,7 @@ class RedisClientRoutersTest extends Unit
|
||||
->with('traefik/' . $protocolEnum->getValue() . '/routers/foo/service')
|
||||
->andReturn('foo');
|
||||
|
||||
$routers = RedisClient::getRouter('foo', $protocolEnum);
|
||||
$routers = new RedisClient()->getRouter('foo', $protocolEnum);
|
||||
|
||||
$this->assertIsArray($routers);
|
||||
|
||||
@@ -138,7 +138,7 @@ class RedisClientRoutersTest extends Unit
|
||||
'traefik/' . $protocol->getValue() . '/routers/bar/url/0',
|
||||
]]);
|
||||
|
||||
$routers = RedisClient::getAllRouters($protocol);
|
||||
$routers = new RedisClient()->getAllRouters($protocol);
|
||||
|
||||
$this->assertIsArray($routers);
|
||||
$this->assertCount(2, $routers);
|
||||
|
||||
@@ -54,7 +54,7 @@ class RedisClientServiceTest extends Unit
|
||||
->once()
|
||||
->andReturn(true);
|
||||
|
||||
RedisClient::createOrReplace('foo', [
|
||||
new RedisClient()->createOrReplace('foo', [
|
||||
'loadbalancer' => [
|
||||
'servers' => [
|
||||
'server1' => [
|
||||
@@ -103,7 +103,7 @@ class RedisClientServiceTest extends Unit
|
||||
->with('traefik/' . $protocol->getValue() . '/services/foo/loadbalancer/servers/server1/url')
|
||||
->andReturn('http://foo.localhost:80');
|
||||
|
||||
$services = RedisClient::getService('foo', $protocol);
|
||||
$services = new RedisClient()->getService('foo', $protocol);
|
||||
|
||||
$this->assertIsArray($services);
|
||||
$this->assertArrayHasKey('loadbalancer', $services);
|
||||
@@ -135,7 +135,7 @@ class RedisClientServiceTest extends Unit
|
||||
'traefik/' . $protocol->getValue() . '/services/bar/loadbalancer/servers/server2/url',
|
||||
]]);
|
||||
|
||||
$services = RedisClient::getAllServices($protocol);
|
||||
$services = new RedisClient()->getAllServices($protocol);
|
||||
|
||||
$this->assertIsArray($services);
|
||||
$this->assertCount(2, $services);
|
||||
|
||||
Reference in New Issue
Block a user