开发者

Group/Filter in phpunit doesnt execute specific test case

开发者 https://www.devze.com 2023-03-16 23:05 出处:网络
i have a suite that calls multiple suites and many functions for 开发者_开发技巧LOG,REPORT and Execution if i m trying the same \'Group or Filter\' pattern its executes all the test cases without exec

i have a suite that calls multiple suites and many functions for 开发者_开发技巧LOG,REPORT and Execution if i m trying the same 'Group or Filter' pattern its executes all the test cases without executing the selected single test cases.

Edit: I am using an array suite as follows,

$suite->addTestSuite('adminSuite');
$suite->addTestSuite('staffSuite');
$suite->addTestSuite('merchantSuite');

// Run the test
PHPUnit_TextUI_TestRunner::run($suite, array(
            'junitLogfile' => $path_log
        ));

I am calling this file through ant.


From the code you've added, it does exactly what you ask for. As you're running the tests with coded configuration, you would need to take care for filtering or selecting groups on your own as well. The regex based filter for test names is set with the run method as a parameter (in the parameter array). Interesting parameters for you might be: filter, groups and excludeGroups. Example:

// Run the test
PHPUnit_TextUI_TestRunner::run($suite, array(
            'junitLogfile' => $path_log,
            'filter' => $yourFilter,
        ));
0

精彩评论

暂无评论...
验证码 换一张
取 消