File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 18
18
*/
19
19
class Timestamp
20
20
{
21
+ const FORMAT = 'Ymd\TH:i:sO ' ;
22
+
21
23
/**
22
24
* @var \DateTime Signing Timestamp
23
25
*/
@@ -69,6 +71,6 @@ public function setValidFor($interval)
69
71
*/
70
72
public function __toString ()
71
73
{
72
- return $ this ->timestamp ->format (' Ymd\TH:i:s.uO ' );
74
+ return $ this ->timestamp ->format (static :: FORMAT );
73
75
}
74
76
}
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ public function testTimestampFormat()
28
28
{
29
29
$ timestamp = new \Akamai \Open \EdgeGrid \Authentication \Timestamp ();
30
30
31
- $ check = \DateTime::createFromFormat ('Ymd\TH:i:s.uO ' , (string ) $ timestamp , new \DateTimeZone ('UTC ' ));
32
- $ this ->assertEquals ($ check, \PHPUnit_Framework_Assert:: readAttribute ( $ timestamp , ' timestamp ' ) );
31
+ $ check = \DateTime::createFromFormat ('Ymd\TH:i:sO ' , (string ) $ timestamp , new \DateTimeZone ('UTC ' ));
32
+ $ this ->assertEquals ($ check-> format (\ Akamai \ Open \ EdgeGrid \ Authentication \Timestamp:: FORMAT ), ( string ) $ timestamp );
33
33
}
34
34
35
35
You can’t perform that action at this time.
0 commit comments