こんにちは。
私はこれをやろうとしているセレン/phpのテストからメールを送信する方法を誰かが知っているかどうか知りたいです:
<?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";
}
}
}
「if($cpt >3)」に入ると、サーバーから次のように言われます: PHPUnit_Framework_Error::__construct() に渡される引数 5 は、C:\wamp\bin\ で呼び出される例外のインスタンスである必要があります。 php\php5.3.5\PEAR\PHPUnit\Extensions\SeleniumTestCase.php の 1152 行で定義済み