我有Selenium服務器在MAMP本地服務器上使用PHPUnit。Selenium不顯示失敗的數字行
當一個斷言失敗,失敗的號碼行不會顯示,而是我看到一個phpunit號碼行。
當我執行「phpunit only」測試時,我可以看到失敗斷言的數字行。
PHPUnit的唯一的測試
$ cd '/Applications/MAMP/htdocs/my-client/tests' && phpunit -c 'phpunit.xml' '/Applications/MAMP/htdocs/my-client/tests/controllers/homeTest.php'
PHPUnit 3.6.10 by Sebastian Bergmann.
Configuration read from /Applications/MAMP/htdocs/my-client/tests/phpunit.xml
.
Time: 0 seconds, Memory: 8.00Mb
There was 1 failure:
1) HomeTest::test_get_sections
Failed asserting that Array (
blah, blah, blah
)
) is identical to Array (blah, blah, blah2
)
).
/Applications/MAMP/htdocs/my-client/tests/controllers/homeTest.php:56
/Applications/MAMP/bin/php/php5.3.6/bin/phpunit:46
FAILURES!
Tests: 2, Assertions: 3, Failures: 1.
PHPUnit的Selenium測試
$ cd '/Applications/MAMP/htdocs/my-client/tests' && phpunit -c 'phpunit.xml'
'/Applications/MAMP/htdocs/my-client/tests/views/af_web_Test.php'
PHPUnit 3.6.10 by Sebastian Bergmann.
Configuration read from /Applications/MAMP/htdocs/my-client/tests/phpunit.xml
E
Time: 2 seconds, Memory: 8.75Mb
There was 1 error:
1) af_web_Test::test_crear_una_af_nueva_y_validar_el_valor_por_defecto_de_los_campos
Current URL: http://localhost:8888/my-client/index.php/home/view
Failed asserting that '' matches PCRE pattern "/0/".
/Applications/MAMP/bin/php/php5.3.6/bin/phpunit:46
FAILURES!
Tests: 1, Assertions: 6, Errors: 1.
我建議你關閉顏色,這樣不顯示ANSI代碼(不使用'--colors'),見http://www.phpunit.de/manual/3.6/en/textui.html - 這裏不是你的問題,只是說,可能會幫助你調試。 – hakre 2012-02-10 12:11:05