From 4988452740e4d8ae347570774f8aaece4372307d Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Mon, 27 Feb 2012 01:46:09 +0100 Subject: Added built_post_subject for stripping tags and Re's added by mailing lists. --- test/build_post_test.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/build_post_test.php (limited to 'test') diff --git a/test/build_post_test.php b/test/build_post_test.php new file mode 100644 index 0000000..72e28a7 --- /dev/null +++ b/test/build_post_test.php @@ -0,0 +1,34 @@ +assertEquals( + build_post_subject($listtag, $forumtag, $subject), + $expected + ); + } + + public function builtPostSubjectProvider() { + return array( + array('[l]', '[f]', '', '(no subject)'), + array('[l]', '[f]', 'Re:', '(no subject)'), + array('[l]', '[f]', 'Subject', 'Subject'), + array('[l]', '[f]', 'Re: Subject', 'Subject'), + array('[l]', '[f]', 'Re: Re: Re: Subject', 'Subject'), + array('[l]', '[f]', '[f] Subject', 'Subject'), + array('[l]', '[f]', '[f] [f] Subject', 'Subject'), + array('[l]', '[f]', '[f] [f] Subject [f]', 'Subject'), + array('[l]', '[f]', '[l] [f] Re: Subject', 'Subject'), + array('[l]', '[f]', 'Re: [l] [f] Subject', 'Subject'), + array('[l]', '[f]', 'Re: Subject [l][f] Subject', 'Subject Subject') + ); + } +} + +?> -- cgit v1.2.3