我想知道我必须在我的测试目录中做什么来停止进入phpunit SetUp.php,只是做phpunit并让它运行该目录中的所有测试?为什么PHP单元无法工作,除非我提供一个文件?
我的目录是:
- 测试
- SetUp.php
类是:
class SetUp extends PHPUnit_Framework_TestCase {
protected $_wp_query;
public function setUp(){
parent::setUp();
global $wp_query;
if($this->_wp_query == null){
$this->_wp_query = $wp_query;
}
}
public function testIsArray(){
$this->assertTrue(is_array($this->_wp_query));
}
}
的思考?
+1 - 可以通过phpunit.xml配置文件中的目录条目进行更改,但这是默认行为 –