From bd8187cbbbd09b5c47ad31c74023597c8005f7d6 Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Thu, 1 Mar 2012 03:35:38 +0100 Subject: build_post should prepend Re: for replies. --- test/build_postTest.php | 70 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 24 deletions(-) (limited to 'test') diff --git a/test/build_postTest.php b/test/build_postTest.php index be542dd..5e8017e 100644 --- a/test/build_postTest.php +++ b/test/build_postTest.php @@ -5,37 +5,59 @@ require_once(__DIR__ . '/../src/build_post.php'); class build_post_test extends PHPUnit_Framework_TestCase { /** @dataProvider build_post_subject_data */ - public function test_build_post_subject($ltag, $ftag, $subject, $expected) { + public function test_build_post_subject($ltag, $ftag, $subject, $reply, $expected) { $this->assertEquals( $expected, - build_post_subject($ltag, $ftag, $subject) + build_post_subject($ltag, $ftag, $subject, $reply) ); } public function build_post_subject_data() { 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'), - array('[l]', '[f]', 'Edit:', '(no subject)'), - array('[l]', '[f]', 'Edit: Re:', '(no subject)'), - array('[l]', '[f]', 'Edit: Subject', 'Subject'), - array('[l]', '[f]', 'Edit: Re: Subject', 'Subject'), - array('[l]', '[f]', 'Edit: Re: Re: Re: Subject', 'Subject'), - array('[l]', '[f]', 'Edit: [f] Subject', 'Subject'), - array('[l]', '[f]', 'Edit: [f] [f] Subject', 'Subject'), - array('[l]', '[f]', 'Edit: [f] [f] Subject [f]', 'Subject'), - array('[l]', '[f]', '[l] [f] Edit: Re: Subject', 'Subject'), - array('[l]', '[f]', 'Edit: Re: [l] [f] Subject', 'Subject'), - array('[l]', '[f]', 'Edit: Re: Subject [l][f] Subject', 'Subject Subject') + array('[l]', '[f]', '', false, '(no subject)'), + array('[l]', '[f]', 'Re:', false, '(no subject)'), + array('[l]', '[f]', 'Subject', false, 'Subject'), + array('[l]', '[f]', 'Re: Subject', false, 'Subject'), + array('[l]', '[f]', 'Re: Re: Re: Subject', false, 'Subject'), + array('[l]', '[f]', '[f] Subject', false, 'Subject'), + array('[l]', '[f]', '[f] [f] Subject', false, 'Subject'), + array('[l]', '[f]', '[f] [f] Subject [f]', false, 'Subject'), + array('[l]', '[f]', '[l] [f] Re: Subject', false, 'Subject'), + array('[l]', '[f]', 'Re: [l] [f] Subject', false, 'Subject'), + array('[l]', '[f]', 'Re: Subject [l][f] Subject', false, 'Subject Subject'), + array('[l]', '[f]', 'Edit:', false, '(no subject)'), + array('[l]', '[f]', 'Edit: Re:', false, '(no subject)'), + array('[l]', '[f]', 'Edit: Subject', false, 'Subject'), + array('[l]', '[f]', 'Edit: Re: Subject', false, 'Subject'), + array('[l]', '[f]', 'Edit: Re: Re: Re: Subject', false, 'Subject'), + array('[l]', '[f]', 'Edit: [f] Subject', false, 'Subject'), + array('[l]', '[f]', 'Edit: [f] [f] Subject', false, 'Subject'), + array('[l]', '[f]', 'Edit: [f] [f] Subject [f]', false, 'Subject'), + array('[l]', '[f]', '[l] [f] Edit: Re: Subject', false, 'Subject'), + array('[l]', '[f]', 'Edit: Re: [l] [f] Subject', false, 'Subject'), + array('[l]', '[f]', 'Edit: Re: Subject [l][f] Subject', false, 'Subject Subject'), + array('[l]', '[f]', '', true, 'Re: (no subject)'), + array('[l]', '[f]', 'Re:', true, 'Re: (no subject)'), + array('[l]', '[f]', 'Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Re: Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Re: Re: Re: Subject', true, 'Re: Subject'), + array('[l]', '[f]', '[f] Subject', true, 'Re: Subject'), + array('[l]', '[f]', '[f] [f] Subject', true, 'Re: Subject'), + array('[l]', '[f]', '[f] [f] Subject [f]', true, 'Re: Subject'), + array('[l]', '[f]', '[l] [f] Re: Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Re: [l] [f] Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Re: Subject [l][f] Subject', true, 'Re: Subject Subject'), + array('[l]', '[f]', 'Edit:', true, 'Re: (no subject)'), + array('[l]', '[f]', 'Edit: Re:', true, 'Re: (no subject)'), + array('[l]', '[f]', 'Edit: Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Edit: Re: Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Edit: Re: Re: Re: Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Edit: [f] Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Edit: [f] [f] Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Edit: [f] [f] Subject [f]', true, 'Re: Subject'), + array('[l]', '[f]', '[l] [f] Edit: Re: Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Edit: Re: [l] [f] Subject', true, 'Re: Subject'), + array('[l]', '[f]', 'Edit: Re: Subject [l][f] Subject', true, 'Re: Subject Subject') ); } } -- cgit v1.2.3