Fix phpunits
This commit is contained in:
parent
e07486b626
commit
7b93c34c0f
@ -3032,7 +3032,7 @@ function dol_print_address($address, $htmlid, $element, $id, $noprint = 0, $char
|
||||
/**
|
||||
* Return true if email syntax is ok.
|
||||
*
|
||||
* @param string $address email (Ex: "toto@examle.com", "John Do <johndo@example.com>")
|
||||
* @param string $address email (Ex: "toto@examle.com". Long form "John Do <johndo@example.com>" will be false)
|
||||
* @param int $acceptsupervisorkey If 1, the special string '__SUPERVISOREMAIL__' is also accepted as valid
|
||||
* @return boolean true if email syntax is OK, false if KO or empty string
|
||||
* @see isValidMXRecord()
|
||||
|
||||
@ -162,7 +162,6 @@ class mailing_xinputfile extends MailingTargets
|
||||
if (!empty($buffer))
|
||||
{
|
||||
//print 'xx'.dol_strlen($buffer).empty($buffer)."<br>\n";
|
||||
$id = $cpt;
|
||||
if (isValidEMail($email))
|
||||
{
|
||||
if ($old <> $email)
|
||||
|
||||
@ -6125,7 +6125,7 @@ class wsdl extends nusoap_base {
|
||||
$rows = sizeof($value);
|
||||
$contents = '';
|
||||
foreach($value as $k => $v) {
|
||||
$this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]");
|
||||
$this->debug("serializing array element: $k of type: ".$typeDef['arrayType']);
|
||||
//if (strpos($typeDef['arrayType'], ':') ) {
|
||||
if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) {
|
||||
$contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);
|
||||
|
||||
@ -131,6 +131,35 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* testIsValidEmail
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIsValidEmail()
|
||||
{
|
||||
// Nb of line is same than entry text
|
||||
|
||||
$input="bidon@bademail";
|
||||
$result=isValidEmail($input);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertFalse($result, 'Check isValidEmail '.$input);
|
||||
|
||||
$input="test@yahoo.com";
|
||||
$result=isValidEmail($input);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result, 'Check isValidEmail '.$input);
|
||||
|
||||
$input="The name of sender <test@yahoo.com>";
|
||||
$result=isValidEmail($input);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertFalse($result, 'Check isValidEmail '.$input);
|
||||
|
||||
$input="1234.abcdefg@domainame.com.br";
|
||||
$result=isValidEmail($input);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result, 'Check isValidEmail '.$input);
|
||||
}
|
||||
|
||||
/**
|
||||
* testIsValidMXRecord
|
||||
|
||||
@ -61,6 +61,9 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
|
||||
|
||||
protected $ns = 'http://www.dolibarr.org/ns/';
|
||||
|
||||
protected $pass = 'admin';
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* We save global variables into local variables
|
||||
@ -248,7 +251,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
|
||||
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
||||
'sourceapplication'=>'DEMO',
|
||||
'login'=>'admin',
|
||||
'password'=>'admin',
|
||||
'password'=>$this->pass,
|
||||
'entity'=>'');
|
||||
|
||||
// Test URL
|
||||
@ -304,7 +307,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
|
||||
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
||||
'sourceapplication'=>'DEMO',
|
||||
'login'=>'admin',
|
||||
'password'=>'admin',
|
||||
'password'=>$this->pass,
|
||||
'entity'=>'');
|
||||
|
||||
// Test URL
|
||||
@ -403,7 +406,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
|
||||
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
||||
'sourceapplication'=>'DEMO',
|
||||
'login'=>'admin',
|
||||
'password'=>'admin',
|
||||
'password'=>$this->pass,
|
||||
'entity'=>'');
|
||||
|
||||
// Test URL
|
||||
|
||||
Loading…
Reference in New Issue
Block a user