public function equals(SignatureInterface $signature) { if ($this->phpVersion !== $signature->getPhpVersion() || $this->fixerVersion !== $signature->getFixerVersion() || $this->rules !== $signature->getRules()) { return false; } return true; }
private function readCache() { $cache = $this->handler->read(); if (!$cache || !$this->signature->equals($cache->getSignature())) { $cache = new Cache($this->signature); } $this->cache = $cache; }
public function testExceedsMinimumDriftThrowsException() { $this->setExpectedException('QueryAuth\\Exception\\DriftExceededException', sprintf('Timestamp is beyond the +-%d second difference allowed.', $this->requestValidator->getDrift())); $badTimestamp = $this->requestValidator->getDrift() + 10; $this->request->expects($this->once())->method('getParams')->willReturn(['signature' => 12345, 'timestamp' => (int) gmdate('U') - $badTimestamp]); $this->signature->expects($this->never())->method('createSignature'); $this->requestValidator->isValid($this->request, $this->credentials); }