日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

工作单元php,php – 无法从工作单元测试用例构建最简单的套件

發布時間:2025/3/15 php 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 工作单元php,php – 无法从工作单元测试用例构建最简单的套件 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我已經開始對我的

PHP程序使用單元測試,并認為Simpletest是一個很好的潛水地點.我將Simpletest文件添加到我的測試服務器,并在我的自定義PDO類上運行以下測試:

require_once('../simpletest/autorun.php');

require_once('../includes/inc_sql.php');

class TestOfSQL extends UnitTestCase{

function testRead(){

...

}

function testWriteAndDelete(){

...

}

}

?>

這一切都很糟糕.我嘗試構建一個涉及(到目前為止)測試文件的測試套件,如下所示:

require_once('../simpletest/autorun.php');

class AllTests extends TestSuite {

function __construct(){

parent::__construct();

$this->addFile('inc_sql_test.php');

}

}

這會崩潰并燒傷,我得到以下讀數:

Warning: include_once(inc_sql_test.php) [function.include-once]: failed to open stream: No such file or directory in E:\xampp\htdocs\historicMuncie\simpletest\test_case.php on line 382

Warning: include_once() [function.include]: Failed opening 'inc_sql_test.php' for inclusion (include_path='.;E:\xampp\php\PEAR') in E:\xampp\htdocs\historicMuncie\simpletest\test_case.php on line 382

Warning: file_get_contents(inc_sql_test.php) [function.file-get-contents]: failed to open stream: No such file or directory in E:\xampp\htdocs\historicMuncie\simpletest\test_case.php on line 418

all_tests.php

Fail: AllTests -> inc_sql_test.php -> Bad TestSuite [inc_sql_test.php] with error [No runnable test cases in [inc_sql_test.php]]

0/0 test cases complete: 0 passes, 1 fails and 0 exceptions.

我已經玩過包含路徑,Web根目錄與服務器根表示法 – 想到的任何事情,但沒有任何東西允許該測試套件正常運行.有任何想法嗎?

總結

以上是生活随笔為你收集整理的工作单元php,php – 无法从工作单元测试用例构建最简单的套件的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。