<?php
class SampleTest extends PHPUnit_Framework_TestCase
{
public function testSomething()
{
// 可選:如果愿意,在這里隨便測試點什么。
$this->assertTrue(TRUE, '這應該已經是能正常工作的。');
// 在這里停止,并將此測試標記為未完成。
$this->markTestIncomplete(
'此測試目前尚未實現。'
);
}
}
?>
在 PHPUnit 命令行測試執(zhí)行器的輸出中,未完成的測試記為 I,如下例所示:
phpunit --verbose SampleTest
PHPUnit 5.0.0 by Sebastian Bergmann and contributors.
I
Time: 0 seconds, Memory: 3.95Mb
There was 1 incomplete test:
1) SampleTest::testSomething
This test has not been implemented yet.
/home/sb/SampleTest.php:12
OK, but incomplete or skipped tests!
Tests: 1, Assertions: 1, Incomplete: 1.
更多建議: