Tests are now compliant with php-cs-fixer (CamelCase for method, phpdoc valid)
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
<?php
|
||||
|
||||
/** DomFramework - Tests
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
* @license BSD
|
||||
*/
|
||||
/**
|
||||
* DomFramework - Tests
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
* @license BSD
|
||||
*/
|
||||
|
||||
namespace Domframework\Tests;
|
||||
|
||||
use Domframework\Mail;
|
||||
|
||||
/** Test the Mail.php file */
|
||||
/**
|
||||
* Test the Mail.php file
|
||||
*/
|
||||
class MailTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSetBodyText1()
|
||||
@@ -91,58 +94,59 @@ class MailTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$mail = new Mail();
|
||||
$res = $mail->convertPeopleToArray("toto toto <toto@toto.com>");
|
||||
$this->assertSame($res, array (array ("name" => "toto toto",
|
||||
"mail" => "toto@toto.com")));
|
||||
$this->assertSame($res, [["name" => "toto toto",
|
||||
"mail" => "toto@toto.com"]]);
|
||||
}
|
||||
|
||||
public function testConvertPeopleToArray2()
|
||||
{
|
||||
$mail = new Mail();
|
||||
$res = $mail->convertPeopleToArray("<toto@toto.com>");
|
||||
$this->assertSame($res, array (array ("name" => "",
|
||||
"mail" => "toto@toto.com")));
|
||||
$this->assertSame($res, [["name" => "",
|
||||
"mail" => "toto@toto.com"]]);
|
||||
}
|
||||
|
||||
public function testConvertPeopleToArray3()
|
||||
{
|
||||
$mail = new Mail();
|
||||
$res = $mail->convertPeopleToArray("toto@toto.com,titi@titi.com");
|
||||
$this->assertSame($res, array (array ("name" => "",
|
||||
"mail" => "toto@toto.com"),
|
||||
array ("name" => "",
|
||||
"mail" => "titi@titi.com")));
|
||||
$this->assertSame($res, [["name" => "",
|
||||
"mail" => "toto@toto.com"],
|
||||
["name" => "",
|
||||
"mail" => "titi@titi.com"]]);
|
||||
}
|
||||
|
||||
public function testConvertPeopleToArray4()
|
||||
{
|
||||
$mail = new Mail();
|
||||
$res = $mail->convertPeopleToArray("toto@toto.com");
|
||||
$this->assertSame($res, array (array ("name" => "",
|
||||
"mail" => "toto@toto.com")));
|
||||
$this->assertSame($res, [["name" => "",
|
||||
"mail" => "toto@toto.com"]]);
|
||||
}
|
||||
|
||||
public function testConvertPeopleToArray5()
|
||||
{
|
||||
$mail = new Mail();
|
||||
$res = $mail->convertPeopleToArray(" <toto@toto.com> , <titi@titi.com>");
|
||||
$this->assertSame($res, array (array ("name" => "",
|
||||
"mail" => "toto@toto.com"),
|
||||
array ("name" => "",
|
||||
"mail" => "titi@titi.com")));
|
||||
$this->assertSame($res, [["name" => "",
|
||||
"mail" => "toto@toto.com"],
|
||||
["name" => "",
|
||||
"mail" => "titi@titi.com"]]);
|
||||
}
|
||||
|
||||
public function testConvertPeopleToArray6()
|
||||
{
|
||||
$mail = new Mail();
|
||||
$res = $mail->convertPeopleToArray("ToTo <toto@toto.com> , <titi@titi.com>");
|
||||
$this->assertSame($res, array (array ("name" => "ToTo",
|
||||
"mail" => "toto@toto.com"),
|
||||
array ("name" => "",
|
||||
"mail" => "titi@titi.com")));
|
||||
$this->assertSame($res, [["name" => "ToTo",
|
||||
"mail" => "toto@toto.com"],
|
||||
["name" => "",
|
||||
"mail" => "titi@titi.com"]]);
|
||||
}
|
||||
|
||||
/** Read all the headers and return them as JSON object
|
||||
*/
|
||||
/**
|
||||
* Read all the headers and return them as JSON object
|
||||
*/
|
||||
public function testHeadersToJSON1()
|
||||
{
|
||||
$mail = new Mail();
|
||||
@@ -190,8 +194,8 @@ http://www.nltk.org/nltk_data/
|
||||
http://www.cs.cmu.edu/~ralf/langid.html
|
||||
"
|
||||
);
|
||||
// }}}
|
||||
$this->assertSame($mail->getHeaders(), array (
|
||||
// }}}
|
||||
$this->assertSame($mail->getHeaders(), [
|
||||
["Return-Path" => "<dominique.fournier@grenoble.cnrs.fr>\n"],
|
||||
["Delivered-To" => "dominique@fournier38.fr\n"],
|
||||
["Received" => "from mail-postfix-mx.fournier38.fr ([192.168.1.103])
|
||||
@@ -229,6 +233,6 @@ http://www.cs.cmu.edu/~ralf/langid.html
|
||||
["X-Spamd-Bar" => "--------------------------------------------------------------------------------------------------\n"],
|
||||
|
||||
|
||||
));
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user