Laravel Dusk的Xdebug在Homestead上的Netbeans中 [英] Xdebug of Laravel Dusk in Netbeans on Homestead

查看:78
本文介绍了Laravel Dusk的Xdebug在Homestead上的Netbeans中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Laravel Homestead中,我已经能够使用Xdebug进行单元测试,功能测试,在浏览器中四处浏览等等.

但是当我尝试将Xdebug用于Dusk(在tests/Browser文件夹中的测试)时,它挂起.

我认为这些问题可能会有所帮助,但我仍然没有使它起作用:

我尝试了各种方法,包括:

export XDEBUG_CONFIG="idekey=netbeans-xdebug remote_connect_back=0 remote_host=10.0.2.2"
php artisan dusk

export XDEBUG_CONFIG="idekey=netbeans-xdebug remote_host=10.0.2.2"
php -dxdebug.remote_autostart=on -dxdebug.remote_connect_back=off -dxdebug.remote_host=10.0.2.2 artisan dusk

更多

我已经在Netbeans中启用了在第一行停止"调试选项,并且Netbeans确实在artisan文件中的第一个可执行PHP行成功停止了.

因此,我认为export XDEBUG_CONFIG="idekey=netbeans-xdebug remote_connect_back=0 remote_host=10.0.2.2"设置正确.

但是,在我单击播放"按钮以允许代码继续运行之后,Netbeans只是在右下角说了"netbeans-xdebug running",而控制台只是挂起,并且光标在此行下闪烁:php artisan dusk tests/Browser/ExampleTest.php

我如何更改Xdebug的用法以使其也能在Dusk中工作?

解决方案

它不起作用,因为Dusk在单独的进程中执行了实际的PHPUnit测试,因此它不了解XDEBUG_CONFIG.

原则上,直接执行Dusk测试(phpunit tests/Browser/ExampleTest.php)时,它们仍然可以工作. php artisan dusk的主要功能是自定义.env.dusk[.local]文件.

如果不需要,您可以尝试直接致电给他们.然后Xdebug的行为应与其他所有PHPUnit测试相同.

In Laravel Homestead, I've been able to use Xdebug for unit tests, feature tests, poking around in the browser, etc.

But it hangs when I try to use Xdebug for Dusk (tests in tests/Browser folder).

I thought these questions might help, but I still haven't gotten it working:

I've tried various approaches, including:

export XDEBUG_CONFIG="idekey=netbeans-xdebug remote_connect_back=0 remote_host=10.0.2.2"
php artisan dusk

and

export XDEBUG_CONFIG="idekey=netbeans-xdebug remote_host=10.0.2.2"
php -dxdebug.remote_autostart=on -dxdebug.remote_connect_back=off -dxdebug.remote_host=10.0.2.2 artisan dusk

and more.

I've enabled the "Stop at First Line" debugging option in Netbeans, and Netbeans does successfully stop at the first executable PHP line in the artisan file.

Therefore I think export XDEBUG_CONFIG="idekey=netbeans-xdebug remote_connect_back=0 remote_host=10.0.2.2" is correctly set up.

But after I click the "play" button to allow the code to continue, Netbeans just says "netbeans-xdebug running" in the bottom right while the console just hangs with a cursor flashing under this line: php artisan dusk tests/Browser/ExampleTest.php

How do I need to change my usage of Xdebug for getting it to work in Dusk too?

解决方案

It doesn't work because Dusk executes the actual PHPUnit test in a separate process, so it doesn't know about XDEBUG_CONFIG.

In principle, Dusk tests still work when you execute them directly (phpunit tests/Browser/ExampleTest.php). The main feature of php artisan dusk are custom .env.dusk[.local] files.

If you don't require that, you can try calling them directly. Then Xdebug should behave the same way it does with all your other PHPUnit tests.

这篇关于Laravel Dusk的Xdebug在Homestead上的Netbeans中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆