Ejemplo n.º 1
0
 public function testGetUrl()
 {
     $manager = new Manager('blub', 'blub');
     $manager->setRegion('region');
     $manager->setEndpoint('sqs.%s.local');
     $this->assertEquals('https://sqs.region.local', $manager->getUrl(), 'Wrong url');
 }
Ejemplo n.º 2
0
 public function testCallWithoutResult()
 {
     $xml = '<?xml version="1.0"?><root></root>';
     $response = new \apiTalk\Response($xml);
     $client = $this->getMockBuilder('AmazonSQS\\Client')->setConstructorArgs(array('accesskey', 'secretkey'))->getMock();
     $client->expects($this->once())->method('post')->with('http://test.x/blub', array('SampleName' => 'SampleValue', 'Action' => 'ExampleAction'))->will($this->returnValue($response));
     $manager = new \AmazonSQS\Manager('accesskey', 'secretkey');
     $manager->setClient($client);
     $this->assertTrue($manager->call('ExampleAction', array('SampleName' => 'SampleValue'), 'http://test.x/blub'), 'Call should be return true');
 }