Update G Unit Test & Fix on G::emailAddress() function
- imcomplete comment exist on G Test file - reoving a G::pr on G::emailAddress() function
This commit is contained in:
@@ -3275,22 +3275,27 @@ $output = $outputHeader.$output;
|
||||
*/
|
||||
function emailAddress($sEmail){
|
||||
$o = new stdClass();
|
||||
|
||||
if( strpos($sEmail, '<') !== false ) {
|
||||
preg_match('/([\"\w@\.-_\s]*\s*)?(<(\w+[\.-]?\w+]*@\w+([\.-]?\w+)*\.\w{2,3})+>)/', $sEmail, $matches);
|
||||
g::pr($matches);
|
||||
|
||||
if( isset($matches[1]) && $matches[3]){
|
||||
$o->email = $matches[3];
|
||||
$o->name = $matches[1];
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
preg_match('/\w+[\.-]?\w+]*@\w+([\.-]?\w+)*\.\w{2,3}+/', $sEmail, $matches);
|
||||
if( isset($matches[0]) ){
|
||||
$o->email = $matches[0];
|
||||
$o->name = '';
|
||||
return $o;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1406,7 +1406,10 @@ class GTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testSendMail()
|
||||
{
|
||||
need email
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user