From 809671070efe8ff29c633e9be03d0d41a5cf6560 Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Mon, 27 Feb 2012 05:08:35 +0100 Subject: Renamed functions in build_email.php. --- test/build_email_test.php | 50 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'test') diff --git a/test/build_email_test.php b/test/build_email_test.php index b4d250c..80768b5 100644 --- a/test/build_email_test.php +++ b/test/build_email_test.php @@ -3,12 +3,12 @@ require_once(__DIR__ . '/../src/build_email.php'); class build_email_test extends PHPUnit_Framework_TestCase { - /** @dataProvider build_text_data */ - public function test_build_text($text, $edit, $expected) { - $this->assertEquals($expected, build_text($text, $edit)); + /** @dataProvider build_email_text_data */ + public function test_build_email_text($text, $edit, $expected) { + $this->assertEquals($expected, build_email_text($text, $edit)); } - public function build_text_data() { + public function build_email_text_data() { return array( array('foo bar', false, 'foo bar'), array('foo bar', true, "[This message has been edited.] @@ -17,22 +17,22 @@ foo bar") ); } - public function test_build_footer() { + public function test_build_email_footer() { $this->assertEquals( " _______________________________________________ Read this topic online here: http://www.example.com/viewtopic.php?p=42#p42", - build_footer(42, 'http://www.example.com') + build_email_footer(42, 'http://www.example.com') ); } - /** @dataProvider build_from_data */ - public function test_build_from($name, $email, $expected) { - $this->assertEquals($expected, build_from($name, $email)); + /** @dataProvider build_email_from_data */ + public function test_build_email_from($name, $email, $expected) { + $this->assertEquals($expected, build_email_from($name, $email)); } - public function build_from_data() { + public function build_email_from_data() { return array( array('Heizölrückstoßabdämpfung', 'foo@example.com', '=?UTF-8?B?SGVpesO2bHLDvGNrc3Rvw59hYmTDpG1wZnVuZw==?= '), array('Joel Uckelman', 'uckelman@nomic.net', 'Joel Uckelman '), @@ -83,11 +83,11 @@ http://www.example.com/viewtopic.php?p=42#p42", '<1267171317.m2f.17507@www.vassalengine.org> <1267473003.m2f.17543@www.vassalengine.org>' ); - protected function call_build_headers(array $headers, array $params) { + protected function call_build_email_headers(array $headers, array $params) { date_default_timezone_set('America/Phoenix'); $this->assertEquals( $headers, - build_headers( + build_email_headers( $params[0], $params[1], $params[2], @@ -103,53 +103,53 @@ http://www.example.com/viewtopic.php?p=42#p42", ); } - public function test_build_headers() { + public function test_build_email_headers() { $headers = $this->default_headers; $headers_params = $this->default_headers_params; - $this->call_build_headers($headers, $headers_params); + $this->call_build_email_headers($headers, $headers_params); } - public function test_build_headers_no_in_reply_to() { + public function test_build_email_headers_no_in_reply_to() { $headers = $this->default_headers; $headers_params = $this->default_headers_params; unset($headers['In-Reply-To']); $headers_params[9] = null; - $this->call_build_headers($headers, $headers_params); + $this->call_build_email_headers($headers, $headers_params); } - public function test_build_headers_no_references() { + public function test_build_email_headers_no_references() { $headers = $this->default_headers; $headers_params = $this->default_headers_params; unset($headers['References']); $headers_params[10] = null; - $this->call_build_headers($headers, $headers_params); + $this->call_build_email_headers($headers, $headers_params); } - public function test_build_headers_utf8_subject() { + public function test_build_email_headers_utf8_subject() { $headers = $this->default_headers; $headers_params = $this->default_headers_params; $headers['Subject'] = '=?UTF-8?B?SGVpesO2bHLDvGNrc3Rvw59hYmTDpG1wZnVuZw==?='; $headers_params[4] = 'Heizölrückstoßabdämpfung'; - $this->call_build_headers($headers, $headers_params); + $this->call_build_email_headers($headers, $headers_params); } - public function test_build_headers_utf8_username() { + public function test_build_email_headers_utf8_username() { $headers = $this->default_headers; $headers_params = $this->default_headers_params; $headers['From'] = '=?UTF-8?B?SGVpesO2bHLDvGNrc3Rvw59hYmTDpG1wZnVuZw==?= '; $headers_params[0] = 'Heizölrückstoßabdämpfung'; - $this->call_build_headers($headers, $headers_params); + $this->call_build_email_headers($headers, $headers_params); } - public function test_build_body_no_attachments() { + public function test_build_email_body_no_attachments() { $headers = array(); $text = 'This is some test text.'; $footer = " @@ -158,7 +158,7 @@ Read this topic online here: http://www.example.com/viewtopic.php?p=42#p42"; $attachments = null; - $body = build_body($headers, $text, $attachments, $footer); + $body = build_email_body($headers, $text, $attachments, $footer); $this->assertEquals('text/plain; charset=UTF-8; format=flowed', $headers['Content-Type']); @@ -166,7 +166,7 @@ http://www.example.com/viewtopic.php?p=42#p42"; $this->assertEquals("$text\n$footer", $body); } - public function test_build_body_attachments() { + public function test_build_email_body_attachments() { // FIXME: This is kind of a complex test to write, because the result // is a Mail_mimePart object. $this->markTestIncomplete(); -- cgit v1.2.3