Hi people,
I would like to know if somebody knows how to send an email from a test in selenium/php I'm trying to do this :
<?php
class Example extends PHPUnit_Extensions_SeleniumTestCase
{
protected function setUp()
{
$this->setBrowser("chrome");
$this->setBrowserUrl("http://recette2011.thalys.com/");
$this->setSpeed(500);
}
public function testMyTestCase()
{
$this->open("/be/en");
$this->click("link=Help");
$this->waitForPageToLoad("30000");
$this->click("id=multi_block_title_span_element_2");
$this->click("id=demande_information");
$this->click("id=type_billet_information_aucun");
$this->click("id=btn_valider");
$this->waitForPageToLoad("30000");
$url = $this->getLocation();
echo $url;
$cpt = substr_count ($url, "&");
if($cpt >3){
if(mail('ths@bytesandcom.be','Test',"Le test a foiré"))
{
echo "message sent";
}
else
{
echo "sent message failed";
}
echo "test failed";
}
else
{
echo "Test Granted";
}
}
}
When i go in the " if($cpt >3)" my server go out telling me : Argument 5 passed to PHPUnit_Framework_Error::__construct() must be an instance of Exception, array given, called in C:\wamp\bin\php\php5.3.5\PEAR\PHPUnit\Exten sions\SeleniumTestCase.php on line 1152 and defined