Integrate PHPT test cases with PHPUnit

前端 未结 2 1019
栀梦
栀梦 2020-12-16 16:15

How can I get PHPUnit to run my PHPT test cases and integrate the pass/fail status into the overall metrics? I am already aware of how to run these tests using run-phpt from

2条回答
  •  天命终不由人
    2020-12-16 16:35

    In your phpunit XML configuration, you can add a testsuite named PHPT (or any other name) and point to the directory where you placed the .phpt files with the suffix set to ".phpt". Phpunit will then execute all phpt-test-files from that directory:

    
        
            test
        
        
            test/phpt
        
    
    

    In this example, the directory test/phpt contains the .phpt files.

    Information about the format how .phpt tests are structured and written is available in depth at:

    • Creating new test files (PHP: Quality Assurance)

提交回复
热议问题