[pLog-svn] r5266 - plog/branches/lifetype-1.2/class/test/tests/file

Jon Daley plogworld at jon.limedaley.com
Tue Apr 3 15:43:31 EDT 2007


 	But this functionality could be achieved by removing all but one 
of the "\" from your regexp, right?  The extra backslashes (two of them) 
are for windows uploaded filenames, right?  Can you show an example where 
all 5 backslashes are needed?  Or are they need to make the chinese work? 
Those characters showed up as spaces in my email client, though I see in 
your email client they showed up differently.
 	I just haven't ever seen more than a couple consecutive backslahes 
when escaping things, unless passing them through javascript and then php, 
but that isn't what we are doing here.

On Wed, 4 Apr 2007, Mark Wu wrote:

> Hi Jon:

The Filename::basename() works great.

Maybe you can add other case for testing.

BTW, I encoded the script file to utf-8 without BOM, because I have to put
down the chinese character in that file.

Mark

> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net 
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of 
> mark at devel.lifetype.net
> Sent: Wednesday, April 04, 2007 3:31 AM
> To: plog-svn at devel.lifetype.net
> Subject: [pLog-svn] r5266 - 
> plog/branches/lifetype-1.2/class/test/tests/file
> 
> Author: mark
> Date: 2007-04-03 15:31:03 -0400 (Tue, 03 Apr 2007) New Revision: 5266
> 
> Added:
> 
> plog/branches/lifetype-1.2/class/test/tests/file/file_test.class.php
> Log:
> Test case for File::basename()
> 
> Added: 
> plog/branches/lifetype-1.2/class/test/tests/file/file_test.class.php
> ===================================================================
> --- 
> plog/branches/lifetype-1.2/class/test/tests/file/file_test.cl
> ass.php	                        (rev 0)
> +++ 
> plog/branches/lifetype-1.2/class/test/tests/file/file_test.cl
> ass.php	2007-04-03 19:31:03 UTC (rev 5266)
> @@ -0,0 +1,25 @@
> +<?php
> +
> +	lt_include( 
> PLOG_CLASS_PATH."class/test/helpers/lifetypetestcase.class.php" );
> +	lt_include( PLOG_CLASS_PATH."class/file/file.class.php" );
> +
> +	/**
> +	 * \ingroup Test
> +	 *
> +	 * Test case for the File class 
> +	 */
> +	class File_Test extends LifeTypeTestCase
> +	{
> +		function testBasename()
> +		{
> +			// test for chinese file name
> +			$this->assertTrue( File::basename( 
> "./gallery/1/¤¤¤åÀɦW.jpg", "¤¤¤åÀɦW.jpg" ));
> +			// test for english file name
> +			$this->assertTrue( File::basename( 
> "./gallery/1/english.jpg", "english.jpg" ));
> +			// test for file name with space
> +			$this->assertTrue( File::basename( 
> "./gallery/1/¤¤¤å name.jpg", "¤¤¤å name.jpg" ));
> +			// test for multiple slashes
> +			$this->assertTrue( File::basename( 
> "/.//gallery//1///¤¤¤å name.jpg", "¤¤¤å name.jpg" ));
> +		}
> +	}
> +?>
> \ No newline at end of file
> 
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn

_______________________________________________
pLog-svn mailing list
pLog-svn at devel.lifetype.net
http://limedaley.com/mailman/listinfo/plog-svn

-- 
Jon Daley
http://jon.limedaley.com/

I won't pass the course, but I don't care.
-- Professor Maly


More information about the pLog-svn mailing list