2013-06-01 38 views
0
public function testheaders() 
{ 
     $url=$this->url('http://www.example.com/index.php'); 
     $kur = get_headers($url); 
     var_dump($kur); 
} 

我得到了errorget_headers(): Filename cannot be empty我如何獲得使用Selenium2的phpunit的html標題?

我的類擴展PHPUnit_Extensions_Selenium2TestCase如同我所有的我的其他測試。

回答

0

get_headers()是一個PHP函數,這將使你的頭信息通過HTTP請求到指定的URL返回。你需要給出的參數是一個字符串,但$ this-> url()返回一個PHPUnit_Selenium對象。

如果您想要該已知網址的標題,爲什麼不直接做?

$kur = get_headers('http://www.example.com/index.php'); 
相關問題