Exemplo n.º 1
0
 public function request_multiple($requests, $options)
 {
     $responses = array();
     foreach ($requests as $id => $request) {
         $handler = new MockTransport();
         $handler->code = $request['options']['mock.code'];
         $handler->chunked = $request['options']['mock.chunked'];
         $handler->body = $request['options']['mock.body'];
         $handler->raw_headers = $request['options']['mock.raw_headers'];
         $responses[$id] = $handler->request($request['url'], $request['headers'], $request['data'], $request['options']);
         if (!empty($options['mock.parse'])) {
             $request['options']['hooks']->dispatch('transport.internal.parse_response', array(&$responses[$id], $request));
             $request['options']['hooks']->dispatch('multiple.request.complete', array(&$responses[$id], $id));
         }
     }
     return $responses;
 }
Exemplo n.º 2
0
 public function testSignatureIsCalculatedCorrectly()
 {
     $transport = new MockTransport('[1,2,3]');
     $mailru = new MailRu(self::APP_ID, self::SECRET_KEY, $this->getCorrectRequestParams(), $transport);
     $mailru->getFriendsIds('1');
     $params = $transport->getLastUsedParams();
     $this->assertEquals($params['sig'], 'b97d6d06acb98f6b66dfb297d773c352');
 }