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