svn: /pear/packages/File/trunk/tests/Util/ Windows/isAbsolute.phpt Windows/realpath.phpt isAbsolute.phpt realpath.phpt
| From: | Helgi Þormar Þorbjörnsson | Date: | Sat, 12 Mar 2011 16:47:56 +0000 |
| Subject: | svn: /pear/packages/File/trunk/tests/Util/ Windows/isAbsolute.phpt Windows/realpath.phpt isAbsolute.phpt realpath.phpt | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-61415@lists.php.net to get a copy of this message | ||
dufuz Sat, 12 Mar 2011 16:47:56 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=309136
Log:
Make a windows version of the realpath test and test case for the latest isAbsolute bug.
Changed paths:
U pear/packages/File/trunk/tests/Util/Windows/isAbsolute.phpt
A pear/packages/File/trunk/tests/Util/Windows/realpath.phpt
U pear/packages/File/trunk/tests/Util/isAbsolute.phpt
U pear/packages/File/trunk/tests/Util/realpath.phpt
Modified: pear/packages/File/trunk/tests/Util/Windows/isAbsolute.phpt
===================================================================
--- pear/packages/File/trunk/tests/Util/Windows/isAbsolute.phpt 2011-03-12 16:47:06 UTC (rev 309135)
+++ pear/packages/File/trunk/tests/Util/Windows/isAbsolute.phpt 2011-03-12 16:47:56 UTC (rev 309136)
@@ -17,10 +17,12 @@
var_dump(File_Util::isAbsolute('C:\\\\data'));
var_dump(File_Util::isAbsolute('d:/data'));
var_dump(File_Util::isAbsolute('\\'));
+var_dump(File_Util::isAbsolute('/Progamme/xampp/htdocs'));
?>
--EXPECT--
bool(false)
bool(false)
bool(true)
bool(true)
-bool(false)
\ No newline at end of file
+bool(false)
+bool(true)
\ No newline at end of file
Added: pear/packages/File/trunk/tests/Util/Windows/realpath.phpt
===================================================================
--- pear/packages/File/trunk/tests/Util/Windows/realpath.phpt (rev 0)
+++ pear/packages/File/trunk/tests/Util/Windows/realpath.phpt 2011-03-12 16:47:56 UTC (rev 309136)
@@ -0,0 +1,23 @@
+--TEST--
+File_Util::realPath() Windows support
+--SKIPIF--
+<?php
+require_once 'File/Util.php';
+if (!FILE_WIN32) {
+ die('SKIP This test is only for Windows');
+}
+?>
+--FILE--
+<?php
+// $Id: $
+require_once 'File/Util.php';
+
+$drive = substr(getcwd(),0, 2);
+var_dump((($drive . '/a/weird/path/is' ===
File_Util::realpath('/a\\weird//path\is/that/./../', '/')) ? true : false));
+var_dump((($drive . '/a/weird/path/is/that' ==
File_Util::realpath('/a\\weird//path\is/that/./../that/.', '/')) ? true :
false));
+var_dump((($drive . '\windows/\system32' ==
File_Util::realpath('/windows/system32')) ? true : false));
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
\ No newline at end of file
Modified: pear/packages/File/trunk/tests/Util/isAbsolute.phpt
===================================================================
--- pear/packages/File/trunk/tests/Util/isAbsolute.phpt 2011-03-12 16:47:06 UTC (rev 309135)
+++ pear/packages/File/trunk/tests/Util/isAbsolute.phpt 2011-03-12 16:47:56 UTC (rev 309136)
@@ -17,11 +17,12 @@
var_dump(File_Util::isAbsolute('/'));
var_dump(File_Util::isAbsolute('\\'));
var_dump(File_Util::isAbsolute('~mike/bin'));
-
+var_dump(File_Util::isAbsolute('/Progamme/xampp/htdocs'));
?>
--EXPECT--
bool(false)
bool(false)
bool(true)
bool(false)
+bool(true)
bool(true)
\ No newline at end of file
Modified: pear/packages/File/trunk/tests/Util/realpath.phpt
===================================================================
--- pear/packages/File/trunk/tests/Util/realpath.phpt 2011-03-12 16:47:06 UTC (rev 309135)
+++ pear/packages/File/trunk/tests/Util/realpath.phpt 2011-03-12 16:47:56 UTC (rev 309136)
@@ -1,13 +1,19 @@
--TEST--
File_Util::realPath()
+--SKIPIF--
+<?php
+require_once 'File/Util.php';
+if (FILE_WIN32) {
+ die('SKIP This test is not for Windows');
+}
+?>
--FILE--
<?php
// $Id: $
require_once 'File/Util.php';
-$drive = FILE_WIN32 ? substr(getcwd(),0, 2) :'';
-var_dump((($drive . '/a/weird/path/is' ===
File_Util::realpath('/a\\weird//path\is/that/./../', '/')) ? true : false));
-var_dump((($drive . '/a/weird/path/is/that' ==
File_Util::realpath('/a\\weird//path\is/that/./../that/.', '/')) ? true :
false));
+var_dump((('/a/weird/path/is' ===
File_Util::realpath('/a\\weird//path\is/that/./../', '/')) ? true : false));
+var_dump((('/a/weird/path/is/that' ==
File_Util::realpath('/a\\weird//path\is/that/./../that/.', '/')) ? true :
false));
?>
--EXPECT--
bool(true)