diff --git a/src/Core/Convert.php b/src/Core/Convert.php
index 277acf4d8..45b8d4df9 100644
--- a/src/Core/Convert.php
+++ b/src/Core/Convert.php
@@ -605,6 +605,6 @@ class Convert
         if ($multiple) {
             return preg_replace('#[/\\\\]+#', $separator, $path);
         }
-        return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);
+        return str_replace(['/', '\\'], $separator, $path);
     }
 }
diff --git a/tests/php/Core/ConvertTest.php b/tests/php/Core/ConvertTest.php
index e92f65330..f435e1eb0 100644
--- a/tests/php/Core/ConvertTest.php
+++ b/tests/php/Core/ConvertTest.php
@@ -259,7 +259,7 @@ PHP
 
     /**
      * Tests {@link Convert::testRaw2URL()}
-  *
+     *
      * @todo test toASCII()
      */
     public function testRaw2URL()
@@ -273,7 +273,7 @@ PHP
 
     /**
      * Helper function for comparing characters with significant whitespaces
-  *
+     *
      * @param string $expected
      * @param string $actual
      */
@@ -590,7 +590,7 @@ XML
     /**
      * Test that bytes2memstring returns a binary prefixed string representing the number of bytes
      *
-     * @param string $memString
+     * @param string $bytes
      * @param int    $expected
      * @dataProvider bytes2MemStringProvider
      */
@@ -613,4 +613,40 @@ XML
             [(512 * 1024 * 1024 * 1024 * 1024 * 1024), '512P']
         ];
     }
+
+    public function providerTestSlashes()
+    {
+        return [
+            ['bob/bob', '/', true, 'bob/bob'],
+            ['\\bob/bob\\', '/', true, '/bob/bob/'],
+            ['\\bob////bob\\/', '/', true, '/bob/bob/'],
+            ['bob/bob', '\\', true, 'bob\\bob'],
+            ['\\bob/bob\\', '\\', true, '\\bob\\bob\\'],
+            ['\\bob////bob\\/', '\\', true, '\\bob\\bob\\'],
+            ['bob/bob', '#', true, 'bob#bob'],
+            ['\\bob/bob\\', '#', true, '#bob#bob#'],
+            ['\\bob////bob\\/', '#', true, '#bob#bob#'],
+            ['bob/bob', '/', false, 'bob/bob'],
+            ['\\bob/bob\\', '/', false, '/bob/bob/'],
+            ['\\bob////bob\\/', '/', false, '/bob////bob//'],
+            ['bob/bob', '\\', false, 'bob\\bob'],
+            ['\\bob/bob\\', '\\', false, '\\bob\\bob\\'],
+            ['\\bob////bob\\/', '\\', false, '\\bob\\\\\\\\bob\\\\'],
+            ['bob/bob', '#', false, 'bob#bob'],
+            ['\\bob/bob\\', '#', false, '#bob#bob#'],
+            ['\\bob////bob\\/', '#', false, '#bob####bob##'],
+        ];
+    }
+
+    /**
+     * @dataProvider providerTestSlashes
+     * @param string $path
+     * @param string $separator
+     * @param bool $multiple
+     * @param string $expected
+     */
+    public function testSlashes($path, $separator, $multiple, $expected)
+    {
+        $this->assertEquals($expected, Convert::slashes($path, $separator, $multiple));
+    }
 }