public function testBasicDescribeIteratorWithFilters() { self::log("\n[#1] Test a basic iterator and make sure deep structures like filters are marshaled correctly."); self::log('Set the region to US-WEST-2.'); $this->client->setRegion(Region::US_WEST_2); self::log('Call DescribeImages via the iterator with some filters and a limit of 5.'); $images = $this->client->getIterator('DescribeImages', array('Owners' => array('amazon'), 'Filters' => array(array('Name' => 'architecture', 'Values' => array('x86_64')), array('Name' => 'image-type', 'Values' => array('machine')))), array('limit' => 5)); self::log('Verify that the iterator returns only 5.'); $this->assertEquals(5, iterator_count($images)); self::log('Verify that the AMI IDs are in the right place and that items actually match the filters.'); foreach ($images as $ami) { $this->assertEquals('x86_64', $ami['Architecture']); $this->assertRegExp('/^ami\\-[a-f0-9]{8}/', $ami['ImageId']); } }