Scalr\Tests\Service\CloudStack\CloudStackTest::testListPublicIpAddresses PHP Method

testListPublicIpAddresses() public method

    public function testListPublicIpAddresses()
    {
        $cloudstack = $this->getCloudStackMock(null, $this->getResponseCallback(substr(__FUNCTION__, 4)));
        $this->assertInstanceOf('Scalr\\Service\\CloudStack\\CloudStack', $cloudstack);
        $ips = $cloudstack->listPublicIpAddresses();
        $this->assertInstanceOf('Scalr\\Service\\CloudStack\\DataType\\IpAddressResponseList', $ips);
        foreach ($ips as $ip) {
            $this->assertInstanceOf('Scalr\\Service\\CloudStack\\DataType\\IpAddressResponseData', $ip);
            $this->assertEquals(13199, $ip->id);
            $this->assertEquals("Scalr-User1", $ip->account);
            $this->assertEquals(new DateTime("2014-02-19T00:04:23+0900", new DateTimeZone('UTC')), $ip->allocated);
            $this->assertEquals(1527, $ip->associatednetworkid);
            $this->assertEquals("Test Name", $ip->associatednetworkname);
            $this->assertEquals("70000001100", $ip->domain);
            $this->assertEquals(1105, $ip->domainid);
            $this->assertEquals(true, $ip->forvirtualnetwork);
            $this->assertEquals("210.140.144.19", $ip->ipaddress);
            $this->assertEquals(false, $ip->isportable);
            $this->assertEquals(true, $ip->issourcenat);
            $this->assertEquals(false, $ip->isstaticnat);
            $this->assertEquals(true, $ip->issystem);
            $this->assertEquals(1476, $ip->networkid);
            $this->assertEquals("testio", $ip->physicalnetworkid);
            $this->assertEquals("Project Test", $ip->project);
            $this->assertEquals(666, $ip->projectid);
            $this->assertEquals("testio", $ip->purpose);
            $this->assertEquals("Allocated", $ip->state);
            $this->assertEquals("test name", $ip->virtualmachinedisplayname);
            $this->assertEquals(42, $ip->virtualmachineid);
            $this->assertEquals("test name", $ip->virtualmachinename);
            $this->assertEquals(1, $ip->vlanid);
            $this->assertEquals("test", $ip->vlanname);
            $this->assertEquals("210.140.144.19", $ip->vmipaddress);
            $this->assertEquals(50, $ip->vpcid);
            $this->assertEquals(2, $ip->zoneid);
            $this->assertEquals("jp-east-f2v", $ip->zonename);
            $this->assertEquals(42, $ip->jobid);
            $this->assertEquals("Done", $ip->jobstatus);
            $this->assertInstanceOf('Scalr\\Service\\CloudStack\\DataType\\ResponseTagsList', $ip->tags);
            foreach ($ip->tags as $tag) {
                $this->assertEquals("testio", $tag->account);
                $this->assertEquals("testio", $tag->customer);
                $this->assertEquals("test.com", $tag->domain);
                $this->assertEquals(42, $tag->domainid);
                $this->assertEquals("key test", $tag->key);
                $this->assertEquals("Project Test", $tag->project);
                $this->assertEquals(666, $tag->projectid);
                $this->assertEquals(11, $tag->resourceid);
                $this->assertEquals("test", $tag->resourcetype);
                $this->assertEquals("testvalue", $tag->value);
                break;
            }
            break;
        }
    }