/**
  * Test method for the <tt>getAuth()</tt> and <tt>setAuth($hwid)</tt> functions.
  */
 public function testGetSetAuth()
 {
     $getTagsRequest = new GetTagsRequest();
     $this->assertNull($getTagsRequest->getAuth());
     $getTagsRequest->setAuth('XXXXXXXX');
     $this->assertEquals('XXXXXXXX', $getTagsRequest->getAuth());
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function getTags(GetTagsRequest $getTagsRequest)
 {
     // If the 'application' attribute is not set in the request we try to get a default one from the Pushwoosh
     // client
     if ($getTagsRequest->getApplication() === null) {
         // The 'application' must be set
         if (!isset($this->application)) {
             throw new PushwooshException('The  \'application\' property is not set !');
         }
         $getTagsRequest->setApplication($this->application);
     }
     // If the 'auth' parameter is not set in the request we try to get it from the Pushwoosh client
     if ($getTagsRequest->getAuth() === null) {
         // The 'auth' parameter is expected here
         if (!isset($this->auth)) {
             throw new PushwooshException('The \'auth\' parameter is not set !');
             // Use the 'auth' parameter defined in the Pushwoosh client
         } else {
             $getTagsRequest->setAuth($this->auth);
         }
     }
     $response = $this->cURLClient->pushwooshCall('getTags', $getTagsRequest->jsonSerialize());
     return GetTagsResponse::create($response);
 }