你PHPUnit的版本是一個有點過時。讓我們確保你是最新的。請不要
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
然後
pear install --force --alldeps phpunit/PHPUnit again
這將導致
downloading PHPUnit-3.5.13.tgz ...
Starting to download PHPUnit-3.5.13.tgz (118,553 bytes)
..........................done: 118,553 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.5.13
如果有任何錯誤,請嘗試使用升級PEAR版本升級到當前版本
pear upgrade-all
DocBlock for the test helper of PHPActiveRecord says
/**
* In order to run these unit tests, you need to install:
* - PHPUnit
* - PEAR Log (otherwise logging SQL queries will be disabled)
* - Memcache (otherwise Caching tests will not be executed)
*
* To run all tests : phpunit AllTests.php --slow-tests
* To run a specific test : phpunit ????Test.php
*/
但在兩個抑制包括在它的日誌依賴
@include_once 'Log.php';
@include_once 'Log/file.php';
這可能是爲什麼你沒有得到的CLI的任何結果,在所有的原因,因此要確保你也做
pear install --force --alldeps Log
那應該可以。
編輯:的1.0版本,可從PHPActiveRecord網站不具備上述文檔塊和日誌依賴使用require_once
。這是當前主版本的變化,所以你可能想嘗試夜間或檢查出從GitHub主分支:
主分支作品對我來說,3次測試,5個斷言。你使用哪個版本?儘管我在GNU/Linux上運行它們。 'testOne'顯然應該是'test_one'。 – greut 2011-04-03 10:37:56
@greut號爲什麼它必須是'test_one'?只要它在前面進行測試,PHPUnit會將其視爲測試。 – Gordon 2011-04-03 10:44:00
如果有什麼它應該是公共功能setup()而不是set_up() – Gordon 2011-04-03 10:50:45