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:
Erik Amaru Ortiz
2012-05-17 17:31:48 -04:00
parent 6fb2f2d786
commit fcef56fd6f
2 changed files with 11 additions and 3 deletions

View File

@@ -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;
}
}

View File

@@ -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.'
);
}
/**