Exemplo n.º 1
0
 /**
  * little helper to create the util class
  *
  * @param Client $client
  *
  * @return Util
  */
 protected function createUtil(Client $client = null)
 {
     $imapHelper = $this->createImapHelper();
     $imapAdapter = $this->createImapAdapter();
     $communicationAdapter = new CommunicationAdapter(new Account('test_user', 'test_password'));
     if ($client != null) {
         $communicationAdapter->setClient($client);
     }
     return new Util($communicationAdapter, $imapAdapter, $imapHelper);
 }
Exemplo n.º 2
0
 /**
  * @param string $url
  * @param array  $params
  * @param int    $type
  *
  * @return bool
  * @throws AccountException
  * @throws ArgumentException
  * @throws CSRException
  * @throws RequestException
  * @throws UnknownApiException
  * @throws UnknownException
  */
 protected function sendBooleanRequest($url, array $params, $type)
 {
     // Response is always url encoded
     $responseArray = $this->communicationAdapter->sendToApi($url, $params, $type);
     if ($responseArray["errorCode"] == 0) {
         return true;
     } else {
         throw $this->createException($responseArray);
     }
 }