Skip to content

Commit 93744ca

Browse files
author
Glen Campbell
committed
Merge pull request #397 from ycombinator/allow-null-logger
Allow repopulation of objects with no logger set.
2 parents 9b31ab6 + 580b8bd commit 93744ca

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/OpenCloud/Common/Base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ protected function getProperty($property)
244244
* @param Log\LoggerInterface $logger
245245
* @return $this
246246
*/
247-
public function setLogger(Log\LoggerInterface $logger)
247+
public function setLogger(Log\LoggerInterface $logger = null)
248248
{
249249
$this->logger = $logger;
250250

tests/OpenCloud/Tests/LoadBalancer/Resource/LoadBalancerTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,12 @@ public function test_Health_Monitor_Is_Refreshed_With_Bespoke_Method()
343343

344344
$this->assertEquals($health->type, 'CONNECT');
345345
}
346+
347+
public function testAddNodeToExistingLoadBalancer()
348+
{
349+
$lb = $this->loadBalancer;
350+
351+
$lb->addNode('2.2.2.2', 80);
352+
$lb->addNodes();
353+
}
346354
}

0 commit comments

Comments
 (0)