Browse Source

Deprecated normalizePath to fix it in the new method normalizeFullPath.
Added some directives for code analysis (Change directive writing x2 for Travis CI).
Added deprecationWarning, and suppress noinspection directive for
deprecation.
Added deprecated function in Test function.

AlPri78 7 years ago
parent
commit
61f5c8e086
2 changed files with 12 additions and 10 deletions
  1. 1 1
      src/Filesystem/Folder.php
  2. 11 9
      tests/TestCase/Filesystem/FolderTest.php

+ 1 - 1
src/Filesystem/Folder.php

@@ -355,7 +355,7 @@ class Folder
      * @param string $path Path to check
      * @return string Set of slashes ("\\" or "/")
      *
-     * @deprecated 3.6.5 This method will be removed in 4.0.0. Use correctSlashFor() instead.
+     * @deprecated 3.7 This method will be removed in 4.0.0. Use correctSlashFor() instead.
      */
     public static function normalizePath($path)
     {

+ 11 - 9
tests/TestCase/Filesystem/FolderTest.php

@@ -685,17 +685,19 @@ class FolderTest extends TestCase
      */
     public function testNormalizePath()
     {
-        $path = '/path/to/file';
-        $result = Folder::normalizePath($path);
-        $this->assertEquals('/', $result);
+        $this->deprecated(function () {
+            $path = '/path/to/file';
+            $result = Folder::normalizePath($path);
+            $this->assertEquals('/', $result);
 
-        $path = '\\path\\\to\\\file';
-        $result = Folder::normalizePath($path);
-        $this->assertEquals('/', $result);
+            $path = '\\path\\\to\\\file';
+            $result = Folder::normalizePath($path);
+            $this->assertEquals('/', $result);
 
-        $path = 'C:\\path\\to\\file';
-        $result = Folder::normalizePath($path);
-        $this->assertEquals('\\', $result);
+            $path = 'C:\\path\\to\\file';
+            $result = Folder::normalizePath($path);
+            $this->assertEquals('\\', $result);
+        });
     }
 
     /**