Enable Xdebug in Behat tests
Chưa có ai nhận issue này.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Feature Request
- Yes, I reviewed the contribution guidelines.
Describe your use case and the problem you are facing
When working with the Behat tests, I'd like to be able to step debug the actual WP CLI + WordPress code which is being run.
Describe the solution you'd like
Add a WP CLI environmental variable to enable Xdebug, which would prepend any WP CLI commands run by Behat with Xdebug environmental variables to enable it.
WP_CLI_TEST_XDEBUG=true composer behat
In wp-cli/wp-cli/php/WP_CLI/Process.php:73 add:
if( getenv( 'WP_CLI_TEST_XDEBUG' ) ) {
$this->command = "XDEBUG_CONFIG=\"idekey=WP_CLI_TEST_XDEBUG remote_connect_back=1 log_level=0\" XDEBUG_MODE=debug $this->command";
}
Drawbacks:
Definitely slower. And I seem to have to click play often, but maybe that's just a PhpStorm setting I've got wrong.
Alternatives:
Edit every Behat feature to add XDEBUG_CONFIG="idekey=WP_CLI_XDEBUG remote_connect_back=1 log_level=0" XDEBUG_MODE=debug as needed.
I seem to need XDEBUG_SESSION=1 sometimes – I certainly did not need it when I opened the issue.
- Ngôn ngữ chính
- PHP
- Star
- 43
- Fork
- 27
- Merge trung bình
- 48 phút
- Pull request đã merge (30 ngày)
- 6
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue tương tự
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/safe-publish#594 ·
-
needs-triage Platform(Default)
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
HttpClient
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
symfony/symfony-docs#23092 ·
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100