Author: Derick Rethans
Date: 2006-09-26 19:40:14 +0200 (Tue, 26 Sep 2006)
New Revision: 3595

Log:
- Fixed a bug that caused the source directory not to be checked for existance
  with ezcFile::findRecursive().

Modified:
   trunk/File/ChangeLog
   trunk/File/src/file.php
   trunk/File/tests/file_find_recursive_test.php

Modified: trunk/File/ChangeLog
===================================================================
--- trunk/File/ChangeLog        2006-09-26 17:32:42 UTC (rev 3594)
+++ trunk/File/ChangeLog        2006-09-26 17:40:14 UTC (rev 3595)
@@ -2,6 +2,8 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 - Fixed bug #8657: added $d->close() before rmdir() in removeRecursive().
+- Fixed a bug that caused the source directory not to be checked for existance
+  with ezcFile::findRecursive().
 
 
 1.0 - Monday 12 June 2006

Modified: trunk/File/src/file.php
===================================================================
--- trunk/File/src/file.php     2006-09-26 17:32:42 UTC (rev 3594)
+++ trunk/File/src/file.php     2006-09-26 17:40:14 UTC (rev 3595)
@@ -47,11 +47,16 @@
      * @param string $sourceDir
      * @param array(string) $includeFilters
      * @param array(string) $excludeFilters
+     *
+     * @throws ezcBaseFileNotFoundException if the $sourceDir directory is not
+     *         a directory or does not exist.
+     * @throws ezcBaseFilePermissionException if the $sourceDir directory could
+     *         not be opened for reading.
      * @return array
      */
     static public function findRecursive( $sourceDir, array $includeFilters = 
array(), array $excludeFilters = array() )
     {
-        if ( !$sourceDir )
+        if ( !is_dir( $sourceDir ) )
         {
             throw new ezcBaseFileNotFoundException( $sourceDir, 'directory' );
         }

Modified: trunk/File/tests/file_find_recursive_test.php
===================================================================
--- trunk/File/tests/file_find_recursive_test.php       2006-09-26 17:32:42 UTC 
(rev 3594)
+++ trunk/File/tests/file_find_recursive_test.php       2006-09-26 17:40:14 UTC 
(rev 3595)
@@ -91,6 +91,19 @@
                self::assertEquals( $expected, ezcFile::findRecursive( "File", 
array( '@xxx@' ) ) );
        }
 
+       public function testNonExistingDirectory()
+       {
+               $expected = array();
+        try
+        {
+            ezcFile::findRecursive( "NotHere", array( '@xxx@' ) );
+        }
+        catch ( ezcBaseFileNotFoundException $e )
+        {
+               self::assertEquals( 'The directory file <NotHere> could not be 
found.', $e->getMessage() );
+        }
+       }
+
     public static function suite()
     {
          return new ezcTestSuite( "ezcFileFindRecursiveTest" );

-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to