@@ -875,11 +875,12 @@ public function testPruneOutdatedSyncTokens(): void {
875875 $ this ->backend ->createCard ($ addressBookId , $ uri , $ this ->vcardTest0 );
876876 $ this ->backend ->updateCard ($ addressBookId , $ uri , $ this ->vcardTest1 );
877877
878- // Do not delete anything if week data as old as ts=0
879- $ deleted = $ this ->backend ->pruneOutdatedSyncTokens (0 , 0 );
878+ // Keep everything by using a retention duration larger than the row age
879+ $ deleted = $ this ->backend ->pruneOutdatedSyncTokens (0 , time () );
880880 self ::assertSame (0 , $ deleted );
881881
882- $ deleted = $ this ->backend ->pruneOutdatedSyncTokens (0 , time ());
882+ // A retention duration of 0 means everything older than "now" is eligible
883+ $ deleted = $ this ->backend ->pruneOutdatedSyncTokens (0 , 0 );
883884 // At least one from the object creation and one from the object update
884885 $ this ->assertGreaterThanOrEqual (2 , $ deleted );
885886 $ changes = $ this ->backend ->getChangesForAddressBook ($ addressBookId , $ syncToken , 1 );
@@ -911,7 +912,7 @@ public function testPruneOutdatedSyncTokens(): void {
911912 $ this ->assertEmpty ($ changes ['deleted ' ]);
912913
913914 // Delete all but last change
914- $ deleted = $ this ->backend ->pruneOutdatedSyncTokens (1 , time () );
915+ $ deleted = $ this ->backend ->pruneOutdatedSyncTokens (1 , 0 );
915916 $ this ->assertEquals (1 , $ deleted ); // We had two changes before, now one
916917
917918 // Only update should remain
@@ -921,6 +922,6 @@ public function testPruneOutdatedSyncTokens(): void {
921922 $ this ->assertEmpty ($ changes ['deleted ' ]);
922923
923924 // Check that no crash occurs when prune is called without current changes
924- $ deleted = $ this ->backend ->pruneOutdatedSyncTokens (1 , time () );
925+ $ deleted = $ this ->backend ->pruneOutdatedSyncTokens (1 , 0 );
925926 }
926927}
0 commit comments