/** * Test method for the <tt>getApplication()</tt> and <tt>setApplication($application)</tt> functions. */ public function testGetSetApplication() { $getTagsRequest = new GetTagsRequest(); $this->assertNull($getTagsRequest->getApplication()); $getTagsRequest->setApplication('APPLICATION'); $this->assertEquals('APPLICATION', $getTagsRequest->getApplication()); }
/** * {@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); }