diff --git a/src/Bundle/ChillDocStoreBundle/Dav/Utils/LockTimeoutAnalyzer.php b/src/Bundle/ChillDocStoreBundle/Dav/Utils/LockTimeoutAnalyzer.php new file mode 100644 index 000000000..2c191d923 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Dav/Utils/LockTimeoutAnalyzer.php @@ -0,0 +1,45 @@ +analyzeTimeout($content); + + self::assertEquals($expected, $result); + } + + public function provideTimeoutData(): iterable + { + yield 'Second-1800' => [ + 'Second-1800', + new \DateInterval('PT1800S'), + ]; + + yield 'Second-3600' => [ + 'Second-3600', + new \DateInterval('PT3600S'), + ]; + + yield 'Infinite' => [ + 'Infinite', + new \DateInterval('PT24H'), // Typically "Infinite" is represented by a long duration or special handling; RFC says it should be long. Let's assume a long one for now or check common practices. + ]; + + yield 'Multiple types, first is Second' => [ + 'Second-1800, Infinite', + new \DateInterval('PT1800S'), + ]; + + yield 'Multiple types, first is Infinite' => [ + 'Infinite, Second-1800', + new \DateInterval('PT24H'), + ]; + } +}