fail('Exception should be thrown when no keys are passed in.'); } catch(Zend_Service_Amazon_Exception $zsae) {} } public function testSetRegion() { TestAmamzonEc2Abstract::setRegion('eu-west-1'); $class = new TestAmamzonEc2Abstract('TestAccessKey', 'TestSecretKey'); $this->assertEquals('eu-west-1', $class->returnRegion()); } public function testSetInvalidRegionThrowsException() { try { TestAmamzonEc2Abstract::setRegion('eu-west-1a'); $this->fail('Invalid Region Set with no Exception Thrown'); } catch (Zend_Service_Amazon_Exception $zsae) { // do nothing } } public function testSignParamsWithSpaceEncodesWithPercentInsteadOfPlus() { $class = new TestAmamzonEc2Abstract('TestAccessKey', 'TestSecretKey'); $ret = $class->testSign(array('Action' => 'Space Test')); // this is the encode signuature with urlencode - It's Invalid! $invalidSignature = 'EeHAfo7cMcLyvH4SW4fEpjo51xJJ4ES1gdjRPxZTlto='; $this->assertNotEquals($ret, $invalidSignature); } } class TestAmamzonEc2Abstract extends Zend_Service_Amazon_Ec2_Abstract { public function returnRegion() { return $this->_region; } public function testSign($params) { return $this->signParameters($params); } }