public function testSuccessResponse()
 {
     $Response = SuccessResponse::initializeByString('{"success": true}');
     $this->assertTrue($Response->isSuccess());
     $this->assertEquals('response:
 success: true', (string) $Response);
     $Response = SuccessResponse::initializeByString('{"success": false}');
     $this->assertFalse($Response->isSuccess());
     $this->assertEquals('response:
 success: false', (string) $Response);
 }
Beispiel #2
0
 /**
  * REST API method user/cancelRecurring implementation
  * @param string $userId user's identifier
  * @return Request user/cancelRecurring request instance
  * @throws ErrorException if there is an API error
  */
 public function userCancelRecurring($userId)
 {
     return $this->getRequest('user/cancelRecurring', ['user' => (string) $userId], function ($string) {
         return SuccessResponse::initializeByString($string);
     });
 }