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