Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed May 16, 2013
1 parent 3215f89 commit 7f39eff
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions test/phpmailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -955,24 +955,25 @@ function test_SmtpKeepAlive()
$this->Mail->SmtpClose();
}

/**
* Test SMTP host connections
*/
function test_SmtpConnect()
{
$this->assertTrue($this->Mail->SmtpConnect(), 'SMTP single connect failed');
$this->Mail->SmtpClose();
$this->Mail->Host = "localhost:12345;10.10.10.10:54321";
$this->assertFalse($this->Mail->SmtpConnect(), 'SMTP bad multi-connect succeeded');
$this->Mail->SmtpClose();
$this->Mail->Host = "localhost:12345;10.10.10.10:54321;".$_REQUEST['mail_host'];
$this->assertTrue($this->Mail->SmtpConnect(), 'SMTP multi-connect failed');
$this->Mail->SmtpClose();
$this->Mail->Host = $_REQUEST['mail_host'];
$this->assertTrue($this->Mail->SmtpConnect(array('ssl' => array('verify_depth' => 10))), 'SMTP connect with options failed');
}
/**
* Test SMTP host connections
*/
function test_SmtpConnect()
{
$this->assertTrue($this->Mail->SmtpConnect(), 'SMTP single connect failed');
$this->Mail->SmtpClose();
$this->Mail->Host = "localhost:12345;10.10.10.10:54321";
$this->assertFalse($this->Mail->SmtpConnect(), 'SMTP bad multi-connect succeeded');
$this->Mail->SmtpClose();
$this->Mail->Host = "localhost:12345;10.10.10.10:54321;".$_REQUEST['mail_host'];
$this->assertTrue($this->Mail->SmtpConnect(), 'SMTP multi-connect failed');
$this->Mail->SmtpClose();
$this->Mail->Host = $_REQUEST['mail_host'];
//Need to pick a harmless option so as not cause problems of its own! socket:bind doesn't work with Travis-CI
$this->assertTrue($this->Mail->SmtpConnect(array('ssl' => array('verify_depth' => 10))), 'SMTP connect with options failed');
}

/**
/**
* Tests this denial of service attack:
* http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
*/
Expand Down

0 comments on commit 7f39eff

Please sign in to comment.