diff --git a/src/Authentication/Timestamp.php b/src/Authentication/Timestamp.php index bbc87f4..923ce3d 100644 --- a/src/Authentication/Timestamp.php +++ b/src/Authentication/Timestamp.php @@ -18,6 +18,8 @@ */ class Timestamp { + const FORMAT = 'Ymd\TH:i:sO'; + /** * @var \DateTime Signing Timestamp */ @@ -69,6 +71,6 @@ public function setValidFor($interval) */ public function __toString() { - return $this->timestamp->format('Ymd\TH:i:s.uO'); + return $this->timestamp->format(static::FORMAT); } } diff --git a/tests/Authentication/TimestampTest.php b/tests/Authentication/TimestampTest.php index 853b96f..93f8a7c 100644 --- a/tests/Authentication/TimestampTest.php +++ b/tests/Authentication/TimestampTest.php @@ -28,8 +28,8 @@ public function testTimestampFormat() { $timestamp = new \Akamai\Open\EdgeGrid\Authentication\Timestamp(); - $check = \DateTime::createFromFormat('Ymd\TH:i:s.uO', (string) $timestamp, new \DateTimeZone('UTC')); - $this->assertEquals($check, \PHPUnit_Framework_Assert::readAttribute($timestamp, 'timestamp')); + $check = \DateTime::createFromFormat('Ymd\TH:i:sO', (string) $timestamp, new \DateTimeZone('UTC')); + $this->assertEquals($check->format(\Akamai\Open\EdgeGrid\Authentication\Timestamp::FORMAT), (string) $timestamp); }