TestCase($name); } // called before the test functions will be executed // this function is defined in PHPUnit_TestCase and overwritten // here function setUp() { $this->abc = new Flay (); } // called after the test functions are executed // this function is defined in PHPUnit_TestCase and overwritten // here function tearDown() { unset($this->abc); } function testToHtml () { $tests_to_html = array( array( 'text'=>"", 'html'=>"" ), array( 'text'=>"This is a text.", 'html'=>"

This is a text.

\n" ), array( 'text'=>"This is a line.\n\n\nThis is\n another one.\n\n", 'html'=>"

This is a line.

\n

This is
\n another one.

\n" ), array( 'text'=>"This line has *bold*, _italic_, and a _combo *bold* and italic_ texts.", 'html'=>"

This line has bold, italic, and a combo bold and italic texts.

\n" ), array( 'text'=>"This line has tags which are
not allowed.", 'html'=>"

This line has <b>tags</b> which are <br />not allowed.

\n", ), array( 'text'=>"[http://sputnik.pl] is a link, but so is [http://sputnik.pl/bla/ this one], and [this is not.", 'html'=>"

http://sputnik.pl is a link, but so is this one, and [this is not.

\n" ), array( 'text'=>"Why don't we try to insert an image.\n\n[http://sputnik.pl/test.jpg]", 'html'=>"

Why don't we try to insert an image.

\n

\"\"

\n" ), array( 'text'=>"Auto-link my.name+real@my-server.com and example@example.com, should work.", 'html'=>"

Auto-link my.name+real@my-server.com and example@example.com, should work.

\n" ), array( 'text'=>"\"\"\"This is a blockquote\"\"\"", 'html'=>"
\n

This is a blockquote

\n
\n" ), array( 'text'=>"How about a blockquote?\"\"\"This is a multiline blockquote.\n\nThis is the second line.\"\"\"\nAnd this is not.", 'html'=>"

How about a blockquote?

\n
\n

This is a multiline blockquote.

\n

This is the second line.

\n
\n

And this is not.

\n" ), array( 'text'=>"Now auto-link an url such as http://sputnik.pl or www.robocik-malowany.com/dupa[4] - or any other.", 'html'=>"

Now auto-link an url such as http://sputnik.pl or www.robocik-malowany.com/dupa[4] – or any other.

\n" ), array( 'text'=>"===This be centered===", 'html'=>"
\n

This be centered

\n
\n" ), array( 'text'=>"===This be centered.\n\nAnd this be centered too,\nalong with this.===\nThis, alas, be not.", 'html'=>"
\n

This be centered.

\n

And this be centered too,
\nalong with this.

\n
\n

This, alas, be not.

\n" ), array( 'text'=>"This tests (C)2004 Someone Else, \"Layer Your Apps(R)\" and Cake(TM).", 'html'=>"

This tests ©2004 Someone Else, \"Layer Your Apps®\" and Cake™.

\n" ), ); foreach ($tests_to_html as $test) { $this->assertEquals($this->abc->toHtml($test['text']), $test['html']); } } } ?>