Skip to content

Commit 2f97f45

Browse files
authored
Merge pull request #195 from Jahsis/floating_ip
Fix issue with retrieving FloatingIP
2 parents f92a7bb + 3aaaf5e commit 2f97f45

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/Networking/v2/Extensions/Layer3/Models/FloatingIp.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function delete()
7070

7171
public function retrieve()
7272
{
73-
$this->executeWithState($this->api->getFloatingIp());
73+
$response = $this->executeWithState($this->api->getFloatingIp());
74+
$this->populateFromResponse($response);
7475
}
7576
}

tests/unit/Networking/v2/Extensions/Layer3/Models/FloatingIpTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,21 @@ public function test_it_retrieves()
4848
$this->setupMock('GET', 'v2.0/floatingips/id', null, [], 'FloatingIp');
4949

5050
$this->floatingIp->retrieve();
51+
52+
$this->assertEquals('376da547-b977-4cfe-9cba-275c80debf57',
53+
$this->floatingIp->floatingNetworkId);
54+
$this->assertEquals('d23abc8d-2991-4a55-ba98-2aaea84cc72f',
55+
$this->floatingIp->routerId);
56+
$this->assertEquals('10.0.0.3',
57+
$this->floatingIp->fixedIpAddress);
58+
$this->assertEquals('172.24.4.228',
59+
$this->floatingIp->floatingIpAddress);
60+
$this->assertEquals('4969c491a3c74ee4af974e6d800c62de',
61+
$this->floatingIp->tenantId);
62+
$this->assertEquals('ACTIVE', $this->floatingIp->status);
63+
$this->assertEquals('ce705c24-c1ef-408a-bda3-7bbd946164ab',
64+
$this->floatingIp->portId);
65+
$this->assertEquals('2f245a7b-796b-4f26-9cf9-9e82d248fda7',
66+
$this->floatingIp->id);
5167
}
5268
}

0 commit comments

Comments
 (0)