Author: dr
Date: Mon Aug 13 13:37:58 2007
New Revision: 5897
Log:
- Fixed tests after moving them from File.
Modified:
trunk/Base/tests/file_calculate_relative_path_test.php
trunk/Base/tests/file_find_recursive_test.php
trunk/Base/tests/file_remove_recursive_test.php
trunk/Base/tests/suite.php
Modified: trunk/Base/tests/file_calculate_relative_path_test.php
==============================================================================
--- trunk/Base/tests/file_calculate_relative_path_test.php [iso-8859-1]
(original)
+++ trunk/Base/tests/file_calculate_relative_path_test.php [iso-8859-1] Mon Aug
13 13:37:58 2007
@@ -4,64 +4,64 @@
* @license http://ez.no/licenses/new_bsd New BSD License
* @version //autogentag//
* @filesource
- * @package File
+ * @package Base
* @subpackage Tests
*/
/**
- * @package File
+ * @package Base
* @subpackage Tests
*/
-class ezcFileCalculateRelativePathTest extends ezcTestCase
+class ezcBaseFileCalculateRelativePathTest extends ezcTestCase
{
public function testRelative1()
{
- $result = ezcFile::calculateRelativePath( 'C:/foo/1/2/php.php',
'C:/foo/bar' );
+ $result = ezcBaseFile::calculateRelativePath( 'C:/foo/1/2/php.php',
'C:/foo/bar' );
self::assertEquals( '..' . DIRECTORY_SEPARATOR . '1' .
DIRECTORY_SEPARATOR . '2' . DIRECTORY_SEPARATOR . 'php.php', $result );
- $result = ezcFile::calculateRelativePath( 'C:/foo/bar/php.php',
'C:/foo/bar' );
+ $result = ezcBaseFile::calculateRelativePath( 'C:/foo/bar/php.php',
'C:/foo/bar' );
self::assertEquals( 'php.php', $result );
- $result = ezcFile::calculateRelativePath( 'C:/php.php',
'C:/foo/bar/1/2');
+ $result = ezcBaseFile::calculateRelativePath( 'C:/php.php',
'C:/foo/bar/1/2');
self::assertEquals( '..' . DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR .
'php.php', $result );
- $result = ezcFile::calculateRelativePath( 'C:/bar/php.php',
'C:/foo/bar/1/2');
+ $result = ezcBaseFile::calculateRelativePath( 'C:/bar/php.php',
'C:/foo/bar/1/2');
self::assertEquals('..' . DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR .
'bar' . DIRECTORY_SEPARATOR . 'php.php', $result);
}
public function testRelative2()
{
- $result = ezcFile::calculateRelativePath( 'C:\\foo\\1\\2\\php.php',
'C:\\foo\\bar' );
+ $result = ezcBaseFile::calculateRelativePath(
'C:\\foo\\1\\2\\php.php', 'C:\\foo\\bar' );
self::assertEquals( '..' . DIRECTORY_SEPARATOR . '1' .
DIRECTORY_SEPARATOR . '2' . DIRECTORY_SEPARATOR . 'php.php', $result );
- $result = ezcFile::calculateRelativePath( 'C:\\foo\\bar\\php.php',
'C:\\foo\\bar' );
+ $result = ezcBaseFile::calculateRelativePath( 'C:\\foo\\bar\\php.php',
'C:\\foo\\bar' );
self::assertEquals( 'php.php', $result );
- $result = ezcFile::calculateRelativePath( 'C:\\php.php',
'C:\\foo\\bar\\1\\2');
+ $result = ezcBaseFile::calculateRelativePath( 'C:\\php.php',
'C:\\foo\\bar\\1\\2');
self::assertEquals( '..' . DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR .
'php.php', $result );
- $result = ezcFile::calculateRelativePath( 'C:\\bar\\php.php',
'C:\\foo\\bar\\1\\2');
+ $result = ezcBaseFile::calculateRelativePath( 'C:\\bar\\php.php',
'C:\\foo\\bar\\1\\2');
self::assertEquals('..' . DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR .
'bar' . DIRECTORY_SEPARATOR . 'php.php', $result);
}
public function testRelative3()
{
- $result = ezcFile::calculateRelativePath( '/foo/1/2/php.php',
'/foo/bar' );
+ $result = ezcBaseFile::calculateRelativePath( '/foo/1/2/php.php',
'/foo/bar' );
self::assertEquals( '..' . DIRECTORY_SEPARATOR . '1' .
DIRECTORY_SEPARATOR . '2' . DIRECTORY_SEPARATOR . 'php.php', $result );
- $result = ezcFile::calculateRelativePath( '/foo/bar/php.php',
'/foo/bar' );
+ $result = ezcBaseFile::calculateRelativePath( '/foo/bar/php.php',
'/foo/bar' );
self::assertEquals( 'php.php', $result );
- $result = ezcFile::calculateRelativePath( '/php.php', '/foo/bar/1/2');
+ $result = ezcBaseFile::calculateRelativePath( '/php.php',
'/foo/bar/1/2');
self::assertEquals( '..' . DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR .
'php.php', $result );
- $result = ezcFile::calculateRelativePath( '/bar/php.php',
'/foo/bar/1/2');
+ $result = ezcBaseFile::calculateRelativePath( '/bar/php.php',
'/foo/bar/1/2');
self::assertEquals('..' . DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR .
'bar' . DIRECTORY_SEPARATOR . 'php.php', $result);
}
public static function suite()
{
- return new PHPUnit_Framework_TestSuite(
"ezcFileCalculateRelativePathTest" );
+ return new PHPUnit_Framework_TestSuite(
"ezcBaseFileCalculateRelativePathTest" );
}
}
?>
Modified: trunk/Base/tests/file_find_recursive_test.php
==============================================================================
--- trunk/Base/tests/file_find_recursive_test.php [iso-8859-1] (original)
+++ trunk/Base/tests/file_find_recursive_test.php [iso-8859-1] Mon Aug 13
13:37:58 2007
@@ -4,15 +4,15 @@
* @license http://ez.no/licenses/new_bsd New BSD License
* @version //autogentag//
* @filesource
- * @package File
+ * @package Base
* @subpackage Tests
*/
/**
- * @package File
+ * @package Base
* @subpackage Tests
*/
-class ezcFileFindRecursiveTest extends ezcTestCase
+class ezcBaseFileFindRecursiveTest extends ezcTestCase
{
public function testRecursive1()
{
@@ -33,7 +33,7 @@
13 => 'File/tests/file_remove_recursive_test.php',
14 => 'File/tests/suite.php',
);
- self::assertEquals( $expected, ezcFile::findRecursive( "File",
array(), array( '@/docs/@', '@svn@', '@\.swp$@' ) ) );
+ self::assertEquals( $expected, ezcBaseFile::findRecursive( "File",
array(), array( '@/docs/@', '@svn@', '@\.swp$@' ) ) );
}
public function testRecursive2()
@@ -55,7 +55,7 @@
13 => './File/tests/file_remove_recursive_test.php',
14 => './File/tests/suite.php',
);
- self::assertEquals( $expected, ezcFile::findRecursive( ".", array(
'@^\./File/@' ), array( '@/docs/@', '@\.svn@', '@\.swp$@' ) ) );
+ self::assertEquals( $expected, ezcBaseFile::findRecursive( ".", array(
'@^\./File/@' ), array( '@/docs/@', '@\.svn@', '@\.swp$@' ) ) );
}
public function testRecursive3()
@@ -65,7 +65,7 @@
1 => 'File/design/file_operations.png',
2 => 'File/design/md5.png',
);
- self::assertEquals( $expected, ezcFile::findRecursive( "File", array(
'@\.png$@' ), array( '@\.svn@' ) ) );
+ self::assertEquals( $expected, ezcBaseFile::findRecursive( "File",
array( '@\.png$@' ), array( '@\.svn@' ) ) );
}
public function testRecursive4()
@@ -78,7 +78,7 @@
4 => 'File/design/md5.png',
5 => 'File/design/requirements.txt',
);
- self::assertEquals( $expected, ezcFile::findRecursive( "File", array(
'@/design/@' ), array( '@\.svn@' ) ) );
+ self::assertEquals( $expected, ezcBaseFile::findRecursive( "File",
array( '@/design/@' ), array( '@\.svn@' ) ) );
}
public function testRecursive5()
@@ -93,13 +93,13 @@
6 => 'File/tests/file_remove_recursive_test.php',
7 => 'File/tests/suite.php',
);
- self::assertEquals( $expected, ezcFile::findRecursive( "File", array(
'@\.(php|txt)$@' ), array( '@/docs/@', '@\.svn@' ) ) );
+ self::assertEquals( $expected, ezcBaseFile::findRecursive( "File",
array( '@\.(php|txt)$@' ), array( '@/docs/@', '@\.svn@' ) ) );
}
public function testRecursive6()
{
$expected = array();
- self::assertEquals( $expected, ezcFile::findRecursive( "File", array(
'@xxx@' ) ) );
+ self::assertEquals( $expected, ezcBaseFile::findRecursive( "File",
array( '@xxx@' ) ) );
}
public function testNonExistingDirectory()
@@ -107,7 +107,7 @@
$expected = array();
try
{
- ezcFile::findRecursive( "NotHere", array( '@xxx@' ) );
+ ezcBaseFile::findRecursive( "NotHere", array( '@xxx@' ) );
}
catch ( ezcBaseFileNotFoundException $e )
{
@@ -117,7 +117,7 @@
public static function suite()
{
- return new PHPUnit_Framework_TestSuite( "ezcFileFindRecursiveTest" );
+ return new PHPUnit_Framework_TestSuite(
"ezcBaseFileFindRecursiveTest" );
}
}
?>
Modified: trunk/Base/tests/file_remove_recursive_test.php
==============================================================================
--- trunk/Base/tests/file_remove_recursive_test.php [iso-8859-1] (original)
+++ trunk/Base/tests/file_remove_recursive_test.php [iso-8859-1] Mon Aug 13
13:37:58 2007
@@ -4,15 +4,15 @@
* @license http://ez.no/licenses/new_bsd New BSD License
* @version //autogentag//
* @filesource
- * @package File
+ * @package Base
* @subpackage Tests
*/
/**
- * @package File
+ * @package Base
* @subpackage Tests
*/
-class ezcFileRemoveRecursiveTest extends ezcTestCase
+class ezcBaseFileRemoveRecursiveTest extends ezcTestCase
{
protected function setUp()
{
@@ -53,72 +53,72 @@
public function testRecursive1()
{
- self::assertEquals( 12, count( ezcFile::findRecursive( $this->tempDir
) ) );
- ezcFile::removeRecursive( $this->tempDir . '/dir1' );
- self::assertEquals( 9, count( ezcFile::findRecursive( $this->tempDir )
) );
- ezcFile::removeRecursive( $this->tempDir . '/dir2' );
- self::assertEquals( 4, count( ezcFile::findRecursive( $this->tempDir )
) );
+ self::assertEquals( 12, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
+ ezcBaseFile::removeRecursive( $this->tempDir . '/dir1' );
+ self::assertEquals( 9, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
+ ezcBaseFile::removeRecursive( $this->tempDir . '/dir2' );
+ self::assertEquals( 4, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
}
public function testRecursive2()
{
- self::assertEquals( 12, count( ezcFile::findRecursive( $this->tempDir
) ) );
+ self::assertEquals( 12, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
try
{
- ezcFile::removeRecursive( $this->tempDir . '/dir3' );
+ ezcBaseFile::removeRecursive( $this->tempDir . '/dir3' );
}
catch ( ezcBaseFileNotFoundException $e )
{
self::assertEquals( "The directory file '{$this->tempDir}/dir3'
could not be found.", $e->getMessage() );
}
- self::assertEquals( 12, count( ezcFile::findRecursive( $this->tempDir
) ) );
+ self::assertEquals( 12, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
}
public function testRecursive3()
{
- self::assertEquals( 12, count( ezcFile::findRecursive( $this->tempDir
) ) );
+ self::assertEquals( 12, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
try
{
- ezcFile::removeRecursive( $this->tempDir . '/dir4' );
+ ezcBaseFile::removeRecursive( $this->tempDir . '/dir4' );
}
catch ( ezcBaseFilePermissionException $e )
{
self::assertEquals( "The file '{$this->tempDir}/dir5' can not be
opened for reading.", $e->getMessage() );
}
- self::assertEquals( 10, count( ezcFile::findRecursive( $this->tempDir
) ) );
+ self::assertEquals( 10, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
}
public function testRecursive4()
{
- self::assertEquals( 12, count( ezcFile::findRecursive( $this->tempDir
) ) );
+ self::assertEquals( 12, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
try
{
- ezcFile::removeRecursive( $this->tempDir . '/dir5' );
+ ezcBaseFile::removeRecursive( $this->tempDir . '/dir5' );
}
catch ( ezcBaseFilePermissionException $e )
{
self::assertEquals( "The file '{$this->tempDir}/dir5' can not be
opened for reading.", $e->getMessage() );
}
- self::assertEquals( 12, count( ezcFile::findRecursive( $this->tempDir
) ) );
+ self::assertEquals( 12, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
}
public function testRecursive5()
{
- self::assertEquals( 12, count( ezcFile::findRecursive( $this->tempDir
) ) );
+ self::assertEquals( 12, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
try
{
- ezcFile::removeRecursive( $this->tempDir . '/dir6' );
+ ezcBaseFile::removeRecursive( $this->tempDir . '/dir6' );
}
catch ( ezcBaseFilePermissionException $e )
{
self::assertEquals( "The file '{$this->tempDir}/dir6/file1.txt'
can not be removed.", $e->getMessage() );
}
- self::assertEquals( 12, count( ezcFile::findRecursive( $this->tempDir
) ) );
+ self::assertEquals( 12, count( ezcBaseFile::findRecursive(
$this->tempDir ) ) );
}
public static function suite()
{
- return new PHPUnit_Framework_TestSuite( "ezcFileRemoveRecursiveTest"
);
+ return new PHPUnit_Framework_TestSuite(
"ezcBaseFileRemoveRecursiveTest" );
}
}
?>
Modified: trunk/Base/tests/suite.php
==============================================================================
--- trunk/Base/tests/suite.php [iso-8859-1] (original)
+++ trunk/Base/tests/suite.php [iso-8859-1] Mon Aug 13 13:37:58 2007
@@ -12,6 +12,9 @@
require_once( "features_test.php");
require_once( "base_options_test.php");
require_once( "struct_test.php");
+require_once 'file_find_recursive_test.php';
+require_once 'file_remove_recursive_test.php';
+require_once 'file_calculate_relative_path_test.php';
/**
* @package Base
@@ -29,6 +32,9 @@
$this->addTest( ezcBaseFeaturesTest::suite() );
$this->addTest( ezcBaseOptionsTest::suite() );
$this->addTest( ezcBaseStructTest::suite() );
+ $this->addTest( ezcBaseFileCalculateRelativePathTest::suite() );
+ $this->addTest( ezcBaseFileFindRecursiveTest::suite() );
+ $this->addTest( ezcBaseFileRemoveRecursiveTest::suite() );
}
public static function suite()
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components