[pLog-svn] r5086 - plog/branches/lifetype-1.2/class/test/tests/data
Jon Daley
plogworld at jon.limedaley.com
Tue Mar 13 19:12:57 EDT 2007
I am not sure what you are asking. Your tests look good. The
three links off of this page:
http://htmlhelp.com/reference/html40/entities/
have more than I knew existed.
As far as I know, the code that I checked in was working as we need it to,
so I would use that to compare to.
On Wed, 14 Mar 2007, Oscar Renalias wrote:
> Jon, can you verify that although simple, test cases that htmlDecode
> should pass?
>
> On 13 Mar 2007, at 23:23, oscar at devel.lifetype.net wrote:
>
>> Author: oscar
>> Date: 2007-03-13 17:23:19 -0400 (Tue, 13 Mar 2007)
>> New Revision: 5086
>>
>> Modified:
>> plog/branches/lifetype-1.2/class/test/tests/data/
>> textfilter_test.class.php
>> Log:
>> Adjusted the test cases for the Textfilter::Domainize() function
>> and added a test case for the Textfilter::htmlDecode() method,
>> hopefully it will help us understand and fix the issue quicker.
>>
>> Modified: plog/branches/lifetype-1.2/class/test/tests/data/
>> textfilter_test.class.php
>> ===================================================================
>> --- plog/branches/lifetype-1.2/class/test/tests/data/
>> textfilter_test.class.php 2007-03-13 20:36:55 UTC (rev 5085)
>> +++ plog/branches/lifetype-1.2/class/test/tests/data/
>> textfilter_test.class.php 2007-03-13 21:23:19 UTC (rev 5086)
>> @@ -59,10 +59,10 @@
>> "test blog" => "test{$sep}blog",
>> "test-blog" => "test{$sep}blog",
>> "test_blog" => "test{$sep}blog",
>> - "test.blog" => "test{$sep}blog",
>> + "test.blog" => "test.blog",
>> "??test//blog" => "testblog",
>> "==================test blog" => "test{$sep}blog",
>> - "this.has.dots_and-hyphens----and spaces " => "this
>> {$sep}has{$sep}dots{$sep}and{$sep}hyphens{$sep}{$sep}{$sep}{$sep}and
>> {$sep}spaces{$sep}"
>> + "this.has.dots_and-hyphens----and spaces " =>
>> "this.has.dots{$sep}and{$sep}hyphens{$sep}{$sep}{$sep}{$sep}and
>> {$sep}spaces"
>> );
>>
>> foreach( $tests as $input => $output ) {
>> @@ -70,5 +70,27 @@
>> $this->assertEquals( $output, $result, "input was: $input" );
>> }
>> }
>> +
>> + /**
>> + * tests the htmlDecode() method
>> + */
>> + function testHtmlDecode()
>> + {
>> + // array with strings and the expected result, the key is the
>> + // input and the value is the expected output, add more if needed
>> + $tests = Array(
>> + "&" => "&",
>> + "test" => "test",
>> + "áé" => "áé",
>> + "äÜ" => "äÜ"
>> + );
>> +
>> + foreach( $tests as $input => $output ) {
>> + // check that the input is equal to the output after
>> processing it with TextFilter::htmlDecode
>> + $this->assertEquals( $output, TextFilter::htmlDecode
>> ( $input ), "Error htmlDecode()-ing string: $input" );
>> + // and that htmlDecode and filterHTMLEntities are really the
>> opposite of each other
>> + $this->assertEquals( $output, Textfilter::htmlDecode
>> ( TextFilter::filterHTMLEntities( $output )));
>> + }
>> + }
>> }
>> ?>
>> \ 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/
Humor: What makes you laugh at something which
would make you mad if it happened to you.
-- Anonymous
More information about the pLog-svn
mailing list