public function testUidSignatureDoesNotAccept181secondDifferentToNowInTimestamp()
 {
     $time = time() - 181;
     list($uid, $secret, $expected) = $this->getUidSignature($time);
     static::assertFalse($this->validator->validateUid($uid, $time, $secret, $expected));
     $time = time() + 181;
     list($uid, $secret, $expected) = $this->getUidSignature($time);
     static::assertFalse($this->validator->validateUid($uid, $time, $secret, $expected));
 }
 /**
  * @param GuzzleResponseInterface $response
  * @return bool
  */
 public function validate(GuzzleResponseInterface $response)
 {
     $data = json_decode($response->getBody(), true);
     if (!is_array($data)) {
         return false;
     }
     foreach ($this->requiredFields as $field) {
         if (!array_key_exists($field, $data)) {
             return false;
         }
     }
     if (array_key_exists('UID', $data) && array_key_exists('UIDSignature', $data) && array_key_exists('signatureTimestamp', $data)) {
         return $this->signatureValidator->validateUid($data['UID'], $data['signatureTimestamp'], $this->secret, $data['UIDSignature']);
     }
     return true;
 }