diff options
author | Joel Uckelman <uckelman@nomic.net> | 2012-03-01 03:35:38 +0100 |
---|---|---|
committer | Joel Uckelman <uckelman@nomic.net> | 2012-03-01 03:35:38 +0100 |
commit | bd8187cbbbd09b5c47ad31c74023597c8005f7d6 (patch) | |
tree | ade8bccc447c877bbfd996c3b07b73a1d235c6f6 /test | |
parent | 39ed0e2ce2abd2377552ea5af36fa25cf1b66a3f (diff) |
build_post should prepend Re: for replies.
Diffstat (limited to 'test')
-rw-r--r-- | test/build_postTest.php | 70 |
1 files changed, 46 insertions, 24 deletions
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') ); } } |