Skip to content

Commit cc50367

Browse files
committed
Add unit test for post->create
1 parent 6eee3ba commit cc50367

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/unit/Networking/v2/Models/PortTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,30 @@ public function test_it_deletes()
6060

6161
$this->port->delete();
6262
}
63+
64+
public function test_it_creates()
65+
{
66+
$opts = [
67+
'networkId' => self::NETWORK_ID,
68+
'fixedIps' => [
69+
[
70+
'ipAdress' => '192.168.254.20',
71+
'subnetId' => 'd8e52c33-b301-4feb-9856-a71b71f06c1d'
72+
]
73+
]
74+
];
75+
76+
$expectedJson = [
77+
'port' => [
78+
'network_id' => self::NETWORK_ID,
79+
'fixed_ips' => [
80+
['ip_address' => '192.168.254.20', 'subnet_id' => 'd8e52c33-b301-4feb-9856-a71b71f06c1d']
81+
]
82+
]
83+
];
84+
85+
86+
$this->setupMock('POST', 'v2.0/ports', $expectedJson, [], 'port_post');
87+
88+
$this->port->create($opts);
6389
}

0 commit comments

Comments
 (0)