Skip to content

Commit 819e94a

Browse files
ycombinatorJamie Hannaford
authored andcommitted
Use mock logger for database service test to supress log output.
1 parent 806002d commit 819e94a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/OpenCloud/Tests/RackspaceTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
namespace OpenCloud\Tests;
1919

20+
use OpenCloud\Tests\MockLogger;
21+
2022
class RackspaceTest extends OpenCloudTestCase
2123
{
2224
const CREDENTIALS = <<<EOT
@@ -30,10 +32,18 @@ public function test_Credentials()
3032

3133
public function test_Factory_Methods()
3234
{
35+
// Inject mock logger
36+
$oldLogger = $this->getClient()->getLogger();
37+
$this->getClient()->setLogger(new MockLogger());
38+
3339
$this->assertInstanceOf(
3440
'OpenCloud\Database\Service',
3541
$this->getClient()->databaseService('cloudDatabases', 'DFW')
3642
);
43+
44+
// Re-inject old logger
45+
$this->getClient()->setLogger($oldLogger);
46+
3747
$this->assertInstanceOf(
3848
'OpenCloud\LoadBalancer\Service',
3949
$this->getClient()->loadBalancerService('cloudLoadBalancers', 'DFW')

0 commit comments

Comments
 (0)