From 3827aea9abb9cd7ef4f78b8f56dbbc8884792054 Mon Sep 17 00:00:00 2001 From: rNoz Date: Sat, 30 Nov 2024 10:13:33 +0100 Subject: [PATCH 1/9] fix+feat(Browser): section tag properly closing + counting nodes --- lib/DAV/Browser/Plugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php index 5b453ac751..16fdbcaf35 100644 --- a/lib/DAV/Browser/Plugin.php +++ b/lib/DAV/Browser/Plugin.php @@ -262,9 +262,6 @@ public function generateDirectoryIndex($path) $node = $this->server->tree->getNodeForPath($path); if ($node instanceof DAV\ICollection) { - $html .= "

Nodes

\n"; - $html .= ''; - $subNodes = $this->server->getPropertiesForChildren($path, [ '{DAV:}displayname', '{DAV:}resourcetype', @@ -273,6 +270,9 @@ public function generateDirectoryIndex($path) '{DAV:}getlastmodified', ]); + $html .= "

Nodes (" . count($subNodes) . ")

\n"; + $html .= '
'; + foreach ($subNodes as $subPath => $subProps) { $subNode = $this->server->tree->getNodeForPath($subPath); $fullPath = $this->server->getBaseUri().HTTP\encodePath($subPath); @@ -322,9 +322,9 @@ public function generateDirectoryIndex($path) } $html .= '
'; + $html .= '
'; } - $html .= ''; $html .= '

Properties

'; $html .= ''; From 0181ee336bf98a7d3bf91d5c89fd631d3f93455f Mon Sep 17 00:00:00 2001 From: rNoz Date: Sat, 30 Nov 2024 10:15:42 +0100 Subject: [PATCH 2/9] refact: Nodes section at the bottom --- lib/DAV/Browser/Plugin.php | 67 +++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php index 16fdbcaf35..daa464f114 100644 --- a/lib/DAV/Browser/Plugin.php +++ b/lib/DAV/Browser/Plugin.php @@ -261,6 +261,40 @@ public function generateDirectoryIndex($path) $html = $this->generateHeader($path ?: '/', $path); $node = $this->server->tree->getNodeForPath($path); + + $html .= '

Properties

'; + $html .= '
'; + + // Allprops request + $propFind = new PropFindAll($path); + $properties = $this->server->getPropertiesByNode($propFind, $node); + + $properties = $propFind->getResultForMultiStatus()[200]; + + foreach ($properties as $propName => $propValue) { + if (!in_array($propName, $this->uninterestingProperties)) { + $html .= $this->drawPropertyRow($propName, $propValue); + } + } + + $html .= '
'; + $html .= '
'; + + /* Start of generating actions */ + + $output = ''; + if ($this->enablePost) { + $this->server->emit('onHTMLActionsPanel', [$node, &$output, $path]); + } + + if ($output) { + $html .= '

Actions

'; + $html .= "
\n"; + $html .= $output; + $html .= "
\n"; + $html .= "
\n"; + } + if ($node instanceof DAV\ICollection) { $subNodes = $this->server->getPropertiesForChildren($path, [ '{DAV:}displayname', @@ -325,39 +359,6 @@ public function generateDirectoryIndex($path) $html .= ''; } - $html .= '

Properties

'; - $html .= ''; - - // Allprops request - $propFind = new PropFindAll($path); - $properties = $this->server->getPropertiesByNode($propFind, $node); - - $properties = $propFind->getResultForMultiStatus()[200]; - - foreach ($properties as $propName => $propValue) { - if (!in_array($propName, $this->uninterestingProperties)) { - $html .= $this->drawPropertyRow($propName, $propValue); - } - } - - $html .= '
'; - $html .= '
'; - - /* Start of generating actions */ - - $output = ''; - if ($this->enablePost) { - $this->server->emit('onHTMLActionsPanel', [$node, &$output, $path]); - } - - if ($output) { - $html .= '

Actions

'; - $html .= "
\n"; - $html .= $output; - $html .= "
\n"; - $html .= "
\n"; - } - $html .= $this->generateFooter(); $this->server->httpResponse->setHeader('Content-Security-Policy', "default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"); From 17907af604222d660b75dfd2391193e605968c1a Mon Sep 17 00:00:00 2001 From: rNoz Date: Sat, 30 Nov 2024 10:32:28 +0100 Subject: [PATCH 3/9] feat: listing (comparing) Nodes by last modified datetime and then displayPath --- lib/DAV/Browser/Plugin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php index daa464f114..d144b0c278 100644 --- a/lib/DAV/Browser/Plugin.php +++ b/lib/DAV/Browser/Plugin.php @@ -608,8 +608,15 @@ protected function compareNodes($a, $b) ? (in_array('{DAV:}collection', $b['{DAV:}resourcetype']->getValue())) : false; - // If same type, sort alphabetically by filename: if ($typeA === $typeB) { + $lastModifiedA = $a['{DAV:}getlastmodified'] ? $a['{DAV:}getlastmodified']->getTime()->getTimestamp() : 0; + $lastModifiedB = $b['{DAV:}getlastmodified'] ? $b['{DAV:}getlastmodified']->getTime()->getTimestamp() : 0; + + if ($lastModifiedA !== $lastModifiedB) { + return $lastModifiedB <=> $lastModifiedA; // Descending order + } + + // If same type and last modified datetime, sort alphabetically by filename: return strnatcasecmp($a['displayPath'], $b['displayPath']); } From 0d8362d76adb5ec9668adc9a00c3291be5030cca Mon Sep 17 00:00:00 2001 From: rNoz Date: Sat, 30 Nov 2024 11:52:22 +0100 Subject: [PATCH 4/9] test: added tests for counting nodes and compareNodes (via reflection) --- tests/Sabre/DAV/Browser/PluginTest.php | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php index 6efb00b081..98180a1b07 100644 --- a/tests/Sabre/DAV/Browser/PluginTest.php +++ b/tests/Sabre/DAV/Browser/PluginTest.php @@ -4,6 +4,8 @@ namespace Sabre\DAV\Browser; +use Sabre\DAV\Xml\Property\GetLastModified; +use DateTime; use Sabre\DAV; use Sabre\HTTP; @@ -82,6 +84,7 @@ public function testCollectionGetRoot() $body = $this->response->getBodyAsString(); self::assertTrue(false !== strpos($body, '/'), $body); + self::assertTrue(false !== strpos($body, 'Nodes (3)'), $body); self::assertTrue(false !== strpos($body, '<a href="/dir/">')); self::assertTrue(false !== strpos($body, '<span class="btn disabled">')); } @@ -182,4 +185,41 @@ public function testGetAssetEscapeBasePath() self::assertEquals(404, $this->response->getStatus(), 'Error: '.$this->response->getBodyAsString()); } + + public function testCollectionNodesOrder() + { + $compareNodes = new \ReflectionMethod($this->plugin, 'compareNodes'); + $compareNodes->setAccessible(true); + + $day1 = new GetLastModified(new DateTime('2000-01-01')); + $day2 = new GetLastModified(new DateTime('2000-01-02')); + + $file1 = [ + '{DAV:}getlastmodified' => $day1, + 'displayPath' => 'file1' + ]; + $file1_clon = [ + '{DAV:}getlastmodified' => $day1, + 'displayPath' => 'file1' + ]; + $file2 = [ + '{DAV:}getlastmodified' => $day1, + 'displayPath' => 'file2' + ]; + $file2_newer = [ + '{DAV:}getlastmodified' => $day2, + 'displayPath' => 'file2' + ]; + + // Case 1: Newer node should come before older node + self::assertEquals(-1, $compareNodes->invoke($this->plugin, $file2_newer, $file2)); + self::assertEquals(1, $compareNodes->invoke($this->plugin, $file1, $file2_newer)); + + // Case 2: Nodes with same lastmodified but different displayPath (alphabetically) + self::assertEquals(-1, $compareNodes->invoke($this->plugin, $file1_clon, $file2)); + self::assertEquals(1, $compareNodes->invoke($this->plugin, $file2, $file1)); + + // Case 3: Nodes with same lastmodified and same displayPath + self::assertEquals(0, $compareNodes->invoke($this->plugin, $file1, $file1_clon)); + } } From bea6faadd0c50e6629bd3309dfb4c68764d4cf69 Mon Sep 17 00:00:00 2001 From: rNoz <rnoz.commits@gmail.com> Date: Sat, 30 Nov 2024 10:13:33 +0100 Subject: [PATCH 5/9] docs+tests: updated ordering function docs and using isset when comparing resources without lastmodified (found in manual UI tests) --- lib/DAV/Browser/Plugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php index d144b0c278..24525aed18 100644 --- a/lib/DAV/Browser/Plugin.php +++ b/lib/DAV/Browser/Plugin.php @@ -590,8 +590,8 @@ protected function serveAsset($assetName) } /** - * Sort helper function: compares two directory entries based on type and - * display name. Collections sort above other types. + * Sort helper function: compares two directory entries based on type, last modified date + * and display name. Collections sort above other types. * * @param array $a * @param array $b @@ -609,8 +609,8 @@ protected function compareNodes($a, $b) : false; if ($typeA === $typeB) { - $lastModifiedA = $a['{DAV:}getlastmodified'] ? $a['{DAV:}getlastmodified']->getTime()->getTimestamp() : 0; - $lastModifiedB = $b['{DAV:}getlastmodified'] ? $b['{DAV:}getlastmodified']->getTime()->getTimestamp() : 0; + $lastModifiedA = isset($a['{DAV:}getlastmodified']) ? $a['{DAV:}getlastmodified']->getTime()->getTimestamp() : 0; + $lastModifiedB = isset($b['{DAV:}getlastmodified']) ? $b['{DAV:}getlastmodified']->getTime()->getTimestamp() : 0; if ($lastModifiedA !== $lastModifiedB) { return $lastModifiedB <=> $lastModifiedA; // Descending order From f2d6f751cf4f418c610381c806091315d829fc25 Mon Sep 17 00:00:00 2001 From: rNoz <rnoz.commits@gmail.com> Date: Sat, 30 Nov 2024 13:07:02 +0100 Subject: [PATCH 6/9] refact+style(UX/UI): showing nodes at top if they are less or equal than 20 --- lib/DAV/Browser/Plugin.php | 139 ++++++++++++++++++++++--------------- 1 file changed, 82 insertions(+), 57 deletions(-) diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php index 24525aed18..977a19c4a9 100644 --- a/lib/DAV/Browser/Plugin.php +++ b/lib/DAV/Browser/Plugin.php @@ -262,6 +262,24 @@ public function generateDirectoryIndex($path) $node = $this->server->tree->getNodeForPath($path); + $subNodes = null; + $numSubNodes = 0; + $maxNodesAtTopSection = 20; + if ($node instanceof DAV\ICollection) { + $subNodes = $this->server->getPropertiesForChildren($path, [ + '{DAV:}displayname', + '{DAV:}resourcetype', + '{DAV:}getcontenttype', + '{DAV:}getcontentlength', + '{DAV:}getlastmodified', + ]); + $numSubNodes = count($subNodes); + if ($numSubNodes && $numSubNodes <= $maxNodesAtTopSection) { + $html .= $this->generateNodesSection($subNodes, $numSubNodes); + $numSubNodes = 0; + } + } + $html .= '<section><h1>Properties</h1>'; $html .= '<table class="propTable">'; @@ -295,74 +313,81 @@ public function generateDirectoryIndex($path) $html .= "</section>\n"; } - if ($node instanceof DAV\ICollection) { - $subNodes = $this->server->getPropertiesForChildren($path, [ - '{DAV:}displayname', - '{DAV:}resourcetype', - '{DAV:}getcontenttype', - '{DAV:}getcontentlength', - '{DAV:}getlastmodified', - ]); - - $html .= "<section><h1>Nodes (" . count($subNodes) . ")</h1>\n"; - $html .= '<table class="nodeTable">'; + // If there are nodes and they are more than the max number to show at the top of the page + if ($numSubNodes) { + $html .= $this->generateNodesSection($subNodes, $numSubNodes); + } - foreach ($subNodes as $subPath => $subProps) { - $subNode = $this->server->tree->getNodeForPath($subPath); - $fullPath = $this->server->getBaseUri().HTTP\encodePath($subPath); - list(, $displayPath) = Uri\split($subPath); + $html .= $this->generateFooter(); - $subNodes[$subPath]['subNode'] = $subNode; - $subNodes[$subPath]['fullPath'] = $fullPath; - $subNodes[$subPath]['displayPath'] = $displayPath; - } - uasort($subNodes, [$this, 'compareNodes']); + $this->server->httpResponse->setHeader('Content-Security-Policy', "default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"); - foreach ($subNodes as $subProps) { - $type = [ - 'string' => 'Unknown', - 'icon' => 'cog', - ]; - if (isset($subProps['{DAV:}resourcetype'])) { - $type = $this->mapResourceType($subProps['{DAV:}resourcetype']->getValue(), $subProps['subNode']); - } + return $html; + } - $html .= '<tr>'; - $html .= '<td class="nameColumn"><a href="'.$this->escapeHTML($subProps['fullPath']).'"><span class="oi" data-glyph="'.$this->escapeHTML($type['icon']).'"></span> '.$this->escapeHTML($subProps['displayPath']).'</a></td>'; - $html .= '<td class="typeColumn">'.$this->escapeHTML($type['string']).'</td>'; - $html .= '<td>'; - if (isset($subProps['{DAV:}getcontentlength'])) { - $html .= $this->escapeHTML($subProps['{DAV:}getcontentlength'].' bytes'); - } - $html .= '</td><td>'; - if (isset($subProps['{DAV:}getlastmodified'])) { - $lastMod = $subProps['{DAV:}getlastmodified']->getTime(); - $html .= $this->escapeHTML($lastMod->format('F j, Y, g:i a')); - } - $html .= '</td><td>'; - if (isset($subProps['{DAV:}displayname'])) { - $html .= $this->escapeHTML($subProps['{DAV:}displayname']); - } - $html .= '</td>'; + /** + * Generates the Nodes section block of HTML. + * + * @param array $subNodes + * @param int $numSubNodes + * + * @return string + */ + protected function generateNodesSection($subNodes, $numSubNodes) + { + $html = "<section><h1>Nodes (" . $numSubNodes . ")</h1>\n"; + $html .= '<table class="nodeTable">'; - $buttonActions = ''; - if ($subProps['subNode'] instanceof DAV\IFile) { - $buttonActions = '<a href="'.$this->escapeHTML($subProps['fullPath']).'?sabreAction=info"><span class="oi" data-glyph="info"></span></a>'; - } - $this->server->emit('browserButtonActions', [$subProps['fullPath'], $subProps['subNode'], &$buttonActions]); + foreach ($subNodes as $subPath => $subProps) { + $subNode = $this->server->tree->getNodeForPath($subPath); + $fullPath = $this->server->getBaseUri().HTTP\encodePath($subPath); + list(, $displayPath) = Uri\split($subPath); - $html .= '<td>'.$buttonActions.'</td>'; - $html .= '</tr>'; + $subNodes[$subPath]['subNode'] = $subNode; + $subNodes[$subPath]['fullPath'] = $fullPath; + $subNodes[$subPath]['displayPath'] = $displayPath; + } + uasort($subNodes, [$this, 'compareNodes']); + + foreach ($subNodes as $subProps) { + $type = [ + 'string' => 'Unknown', + 'icon' => 'cog', + ]; + if (isset($subProps['{DAV:}resourcetype'])) { + $type = $this->mapResourceType($subProps['{DAV:}resourcetype']->getValue(), $subProps['subNode']); } - $html .= '</table>'; - $html .= '</section>'; - } + $html .= '<tr>'; + $html .= '<td class="nameColumn"><a href="'.$this->escapeHTML($subProps['fullPath']).'"><span class="oi" data-glyph="'.$this->escapeHTML($type['icon']).'"></span> '.$this->escapeHTML($subProps['displayPath']).'</a></td>'; + $html .= '<td class="typeColumn">'.$this->escapeHTML($type['string']).'</td>'; + $html .= '<td>'; + if (isset($subProps['{DAV:}getcontentlength'])) { + $html .= $this->escapeHTML($subProps['{DAV:}getcontentlength'].' bytes'); + } + $html .= '</td><td>'; + if (isset($subProps['{DAV:}getlastmodified'])) { + $lastMod = $subProps['{DAV:}getlastmodified']->getTime(); + $html .= $this->escapeHTML($lastMod->format('F j, Y, g:i a')); + } + $html .= '</td><td>'; + if (isset($subProps['{DAV:}displayname'])) { + $html .= $this->escapeHTML($subProps['{DAV:}displayname']); + } + $html .= '</td>'; - $html .= $this->generateFooter(); + $buttonActions = ''; + if ($subProps['subNode'] instanceof DAV\IFile) { + $buttonActions = '<a href="'.$this->escapeHTML($subProps['fullPath']).'?sabreAction=info"><span class="oi" data-glyph="info"></span></a>'; + } + $this->server->emit('browserButtonActions', [$subProps['fullPath'], $subProps['subNode'], &$buttonActions]); - $this->server->httpResponse->setHeader('Content-Security-Policy', "default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"); + $html .= '<td>'.$buttonActions.'</td>'; + $html .= '</tr>'; + } + $html .= '</table>'; + $html .= '</section>'; return $html; } From 4bb79d084d9caade78f13a6f4d7f1fe46d43ee47 Mon Sep 17 00:00:00 2001 From: rNoz <rnoz.commits@gmail.com> Date: Sat, 21 Dec 2024 18:48:34 +0100 Subject: [PATCH 7/9] test: added tests to check where is Nodes section --- tests/Sabre/DAV/Browser/PluginTest.php | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php index 98180a1b07..ac4c5e8459 100644 --- a/tests/Sabre/DAV/Browser/PluginTest.php +++ b/tests/Sabre/DAV/Browser/PluginTest.php @@ -87,6 +87,19 @@ public function testCollectionGetRoot() self::assertTrue(false !== strpos($body, 'Nodes (3)'), $body); self::assertTrue(false !== strpos($body, '<a href="/dir/">')); self::assertTrue(false !== strpos($body, '<span class="btn disabled">')); + + $dom = new \DOMDocument('1.0', 'utf-8'); + $dom->loadXML($body); + $xpath = new \DOMXPath($dom); + + $sections = $xpath->query('//section'); + + $firstSectionContainsNodes = false; + if ($sections->length > 0) { + $firstH1 = $xpath->query('.//h1[text()="Nodes (3)"]', $sections->item(0)); + $firstSectionContainsNodes = $firstH1->length > 0; + } + self::assertTrue($firstSectionContainsNodes, 'First section is listing Nodes (3)'); } public function testGETPassthru() @@ -186,6 +199,38 @@ public function testGetAssetEscapeBasePath() self::assertEquals(404, $this->response->getStatus(), 'Error: '.$this->response->getBodyAsString()); } + public function testCollectionWithManyNodesGetSubdir() + { + $dir = $this->server->tree->getNodeForPath('dir2'); + $dir->createDirectory('subdir'); + $maxNodes = 20; // directory + 20 files + for ($i = 1; $i <= $maxNodes; $i++) { + $dir->createFile("file$i"); + } + + $request = new HTTP\Request('GET', '/dir2'); + $this->server->httpRequest = ($request); + $this->server->exec(); + + $body = $this->response->getBodyAsString(); + self::assertTrue(false !== strpos($body, 'Nodes (21)'), $body); + self::assertTrue(false !== strpos($body, '<a href="/dir2/subdir/">')); + + $dom = new \DOMDocument('1.0', 'utf-8'); + $dom->loadXML($body); + $xpath = new \DOMXPath($dom); + + $sections = $xpath->query('//section'); + + $lastSectionContainsNodes = false; + if ($sections->length > 1) { + $lastH1 = $xpath->query('.//h1[text()="Nodes (21)"]', $sections->item($sections->length - 1)); + $lastSectionContainsNodes = $lastH1->length > 0; + } + self::assertTrue($lastSectionContainsNodes, 'Last section is listing Nodes (21)'); + } + + public function testCollectionNodesOrder() { $compareNodes = new \ReflectionMethod($this->plugin, 'compareNodes'); From 23a81907f4d9520ed2bff53751ea0ab572e902e2 Mon Sep 17 00:00:00 2001 From: rNoz <rnoz.commits@gmail.com> Date: Sat, 21 Dec 2024 18:53:43 +0100 Subject: [PATCH 8/9] chore: updating styles manually (cs-fixer) --- lib/DAV/Browser/Plugin.php | 9 +++++---- tests/Sabre/DAV/Browser/PluginTest.php | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php index 977a19c4a9..2da36b8da0 100644 --- a/lib/DAV/Browser/Plugin.php +++ b/lib/DAV/Browser/Plugin.php @@ -275,8 +275,8 @@ public function generateDirectoryIndex($path) ]); $numSubNodes = count($subNodes); if ($numSubNodes && $numSubNodes <= $maxNodesAtTopSection) { - $html .= $this->generateNodesSection($subNodes, $numSubNodes); - $numSubNodes = 0; + $html .= $this->generateNodesSection($subNodes, $numSubNodes); + $numSubNodes = 0; } } @@ -329,13 +329,13 @@ public function generateDirectoryIndex($path) * Generates the Nodes section block of HTML. * * @param array $subNodes - * @param int $numSubNodes + * @param int $numSubNodes * * @return string */ protected function generateNodesSection($subNodes, $numSubNodes) { - $html = "<section><h1>Nodes (" . $numSubNodes . ")</h1>\n"; + $html = '<section><h1>Nodes ('.$numSubNodes.")</h1>\n"; $html .= '<table class="nodeTable">'; foreach ($subNodes as $subPath => $subProps) { @@ -388,6 +388,7 @@ protected function generateNodesSection($subNodes, $numSubNodes) $html .= '</table>'; $html .= '</section>'; + return $html; } diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php index ac4c5e8459..4cd0791cab 100644 --- a/tests/Sabre/DAV/Browser/PluginTest.php +++ b/tests/Sabre/DAV/Browser/PluginTest.php @@ -4,10 +4,10 @@ namespace Sabre\DAV\Browser; -use Sabre\DAV\Xml\Property\GetLastModified; use DateTime; use Sabre\DAV; use Sabre\HTTP; +use Sabre\DAV\Xml\Property\GetLastModified; class PluginTest extends DAV\AbstractServerTestCase { @@ -241,19 +241,19 @@ public function testCollectionNodesOrder() $file1 = [ '{DAV:}getlastmodified' => $day1, - 'displayPath' => 'file1' + 'displayPath' => 'file1', ]; $file1_clon = [ '{DAV:}getlastmodified' => $day1, - 'displayPath' => 'file1' + 'displayPath' => 'file1', ]; $file2 = [ '{DAV:}getlastmodified' => $day1, - 'displayPath' => 'file2' + 'displayPath' => 'file2', ]; $file2_newer = [ '{DAV:}getlastmodified' => $day2, - 'displayPath' => 'file2' + 'displayPath' => 'file2', ]; // Case 1: Newer node should come before older node From a1c5ea29b4ee4cd2f0c74758263cb809dfa4e967 Mon Sep 17 00:00:00 2001 From: Phil Davis <phil@jankaritech.com> Date: Tue, 7 Jan 2025 13:39:12 +0545 Subject: [PATCH 9/9] chore: apply cs-fixer style changes --- tests/Sabre/DAV/Browser/PluginTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php index 4cd0791cab..1f23ab996c 100644 --- a/tests/Sabre/DAV/Browser/PluginTest.php +++ b/tests/Sabre/DAV/Browser/PluginTest.php @@ -6,8 +6,8 @@ use DateTime; use Sabre\DAV; -use Sabre\HTTP; use Sabre\DAV\Xml\Property\GetLastModified; +use Sabre\HTTP; class PluginTest extends DAV\AbstractServerTestCase { @@ -204,7 +204,7 @@ public function testCollectionWithManyNodesGetSubdir() $dir = $this->server->tree->getNodeForPath('dir2'); $dir->createDirectory('subdir'); $maxNodes = 20; // directory + 20 files - for ($i = 1; $i <= $maxNodes; $i++) { + for ($i = 1; $i <= $maxNodes; ++$i) { $dir->createFile("file$i"); } @@ -230,7 +230,6 @@ public function testCollectionWithManyNodesGetSubdir() self::assertTrue($lastSectionContainsNodes, 'Last section is listing Nodes (21)'); } - public function testCollectionNodesOrder() { $compareNodes = new \ReflectionMethod($this->plugin, 'compareNodes');