@@ -27,7 +27,11 @@ public function testCreateNewToken()
2727 {
2828 $ provider = $ this ->bootstrapProvider ();
2929
30- $ token = new PersistentToken ('someClass ' , 'someUser ' , 'someSeries ' , 'tokenValue ' , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
30+ if (method_exists (PersistentToken::class, 'getClass ' )) {
31+ $ token = new PersistentToken ('someClass ' , 'someUser ' , 'someSeries ' , 'tokenValue ' , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ), false );
32+ } else {
33+ $ token = new PersistentToken ('someUser ' , 'someSeries ' , 'tokenValue ' , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
34+ }
3135 $ provider ->createNewToken ($ token );
3236
3337 $ this ->assertEquals ($ provider ->loadTokenBySeries ('someSeries ' ), $ token );
@@ -45,7 +49,12 @@ public function testUpdateToken()
4549 {
4650 $ provider = $ this ->bootstrapProvider ();
4751
48- $ token = new PersistentToken ('someClass ' , 'someUser ' , 'someSeries ' , 'tokenValue ' , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
52+ if (method_exists (PersistentToken::class, 'getClass ' )) {
53+ $ token = new PersistentToken ('someClass ' , 'someUser ' , 'someSeries ' , 'tokenValue ' , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ), false );
54+ } else {
55+ $ token = new PersistentToken ('someUser ' , 'someSeries ' , 'tokenValue ' , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
56+ }
57+
4958 $ provider ->createNewToken ($ token );
5059 $ provider ->updateToken ('someSeries ' , 'newValue ' , $ lastUsed = new \DateTime ('2014-06-26T22:03:46 ' ));
5160 $ token = $ provider ->loadTokenBySeries ('someSeries ' );
@@ -57,7 +66,11 @@ public function testUpdateToken()
5766 public function testDeleteToken ()
5867 {
5968 $ provider = $ this ->bootstrapProvider ();
60- $ token = new PersistentToken ('someClass ' , 'someUser ' , 'someSeries ' , 'tokenValue ' , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
69+ if (method_exists (PersistentToken::class, 'getClass ' )) {
70+ $ token = new PersistentToken ('someClass ' , 'someUser ' , 'someSeries ' , 'tokenValue ' , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ), false );
71+ } else {
72+ $ token = new PersistentToken ('someUser ' , 'someSeries ' , 'tokenValue ' , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
73+ }
6174 $ provider ->createNewToken ($ token );
6275 $ provider ->deleteTokenBySeries ('someSeries ' );
6376
@@ -74,7 +87,11 @@ public function testVerifyOutdatedTokenAfterParallelRequest()
7487 $ newValue = 'newValue ' ;
7588
7689 // setup existing token
77- $ token = new PersistentToken ('someClass ' , 'someUser ' , $ series , $ oldValue , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
90+ if (method_exists (PersistentToken::class, 'getClass ' )) {
91+ $ token = new PersistentToken ('someClass ' , 'someUser ' , $ series , $ oldValue , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ), false );
92+ } else {
93+ $ token = new PersistentToken ('someUser ' , $ series , $ oldValue , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
94+ }
7895 $ provider ->createNewToken ($ token );
7996
8097 // new request comes in requiring remember-me auth, which updates the token
@@ -99,7 +116,11 @@ public function testVerifyOutdatedTokenAfterParallelRequestFailsAfter60Seconds()
99116 $ newValue = 'newValue ' ;
100117
101118 // setup existing token
102- $ token = new PersistentToken ('someClass ' , 'someUser ' , $ series , $ oldValue , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
119+ if (method_exists (PersistentToken::class, 'getClass ' )) {
120+ $ token = new PersistentToken ('someClass ' , 'someUser ' , $ series , $ oldValue , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ), false );
121+ } else {
122+ $ token = new PersistentToken ('someUser ' , $ series , $ oldValue , new \DateTimeImmutable ('2013-01-26T18:23:51 ' ));
123+ }
103124 $ provider ->createNewToken ($ token );
104125
105126 // new request comes in requiring remember-me auth, which updates the token
0 commit comments