Add more phpunit tests
This commit is contained in:
parent
ac6f8e4e7c
commit
73e6a00d3e
@ -255,7 +255,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
|||||||
//if ($reg[0] != 'db') $ok=false;
|
//if ($reg[0] != 'db') $ok=false;
|
||||||
}
|
}
|
||||||
//print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n";
|
//print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n";
|
||||||
$this->assertTrue($ok, 'Found a $this->db->idate to forge a sql request without quotes around this date field '.$file['relativename'].' :: '.$val[0]);
|
$this->assertTrue($ok, 'Found a $this->db->idate to forge a sql request without quotes around this date field '.$file['relativename']);
|
||||||
//exit;
|
//exit;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -148,6 +148,13 @@ class Functions2LibTest extends PHPUnit\Framework\TestCase
|
|||||||
*/
|
*/
|
||||||
public function testIsValidMailDomain()
|
public function testIsValidMailDomain()
|
||||||
{
|
{
|
||||||
|
$mail = 'bidon@unvalid.unvalid';
|
||||||
|
$result = isValidMailDomain($mail);
|
||||||
|
$this->assertEquals(0, $result, 'Email isValidMailDomain('.$mail.') should return 0 (not valid) but returned '.$result);
|
||||||
|
|
||||||
|
$mail = 'bidon@dolibarr.org';
|
||||||
|
$result = isValidMailDomain($mail);
|
||||||
|
$this->assertEquals(1, $result, 'Email isValidMailDomain('.$mail.') should return 1 (valid) but returned '.$result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user