spfcheck : manage the FAIL if a minus is set in part

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@6031 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2020-08-21 09:36:26 +00:00
parent 283109bef4
commit 5997150c43
2 changed files with 55 additions and 2 deletions

View File

@@ -217,7 +217,7 @@ class spfcheckTest extends PHPUnit_Framework_TestCase
"+a" => array (),
"+mx" => array (),
"+ip4:178.33.236.5" => array ("178.33.236.5"),
"+ip4:137.74.69.64" => array ("137.74.69.64"),
"-ip4:137.74.69.64" => array ("137.74.69.64"),
"+ip4:51.254.45.81" => array ("51.254.45.81"),
"-all" => array (),
)));
@@ -232,4 +232,32 @@ class spfcheckTest extends PHPUnit_Framework_TestCase
"unknown" => array (),
"-all" => array ())));
}
public function test_ipCheckToSPF_OK_inA ()
{
$spfcheck = new spfcheck ();
$res = $spfcheck->ipCheckToSPF ("plus.spf.tester.fournier38.fr", "178.33.236.5");
$this->assertSame ($res, "PASS");
}
public function test_ipCheckToSPF_FAIL_inALL ()
{
$spfcheck = new spfcheck ();
$res = $spfcheck->ipCheckToSPF ("plus.spf.tester.fournier38.fr", "1.3.6.5");
$this->assertSame ($res, "FAIL");
}
public function test_ipCheckToSPF_OK_inALL ()
{
$spfcheck = new spfcheck ();
$res = $spfcheck->ipCheckToSPF ("plus.spf.tester.fournier38.fr", "1.3.6.5");
$this->assertSame ($res, "FAIL");
}
public function test_ipCheckToSPF_FAIL_inIP4 ()
{
$spfcheck = new spfcheck ();
$res = $spfcheck->ipCheckToSPF ("plus.spf.tester.fournier38.fr", "137.74.69.64");
$this->assertSame ($res, "FAIL");
}
}