/** * Test method for the <tt>getApplication()</tt> and <tt>setApplication($application)</tt> functions. */ public function testGetSetApplication() { $getNearestZoneRequest = new GetNearestZoneRequest(); $this->assertNull($getNearestZoneRequest->getApplication()); $getNearestZoneRequest->setApplication('APPLICATION'); $this->assertEquals('APPLICATION', $getNearestZoneRequest->getApplication()); }
/** * {@inheritDoc} */ public function getNearestZone(GetNearestZoneRequest $getNearestZoneRequest) { // If the 'application' attribute is not set in the request we try to get a default one from the Pushwoosh // client if ($getNearestZoneRequest->getApplication() === null) { // The 'application' must be set if (!isset($this->application)) { throw new PushwooshException('The \'application\' property is not set !'); } $getNearestZoneRequest->setApplication($this->application); } $response = $this->cURLClient->pushwooshCall('getNearestZone', $getNearestZoneRequest->jsonSerialize()); return GetNearestZoneResponse::create($response); }