Have you seen the Xdebug + PhpStorm addon?
Click on your Addon icon in the sidebar and install.
Have you seen the Xdebug + PhpStorm addon?
Click on your Addon icon in the sidebar and install.
Yes, I am using that add-on already. It lets me run Xdebug, but as far as I can tell it does not give me access to unit tests through PHPUnit, because it needs to connect to a database. Thatās why I was asking about setting up ports.
I run phpunit via the CLI. The script sets up the database, etc. I know it works on a Mac and likely on Un*x. I donāt run phpunit via the IDE so that might make a difference.
@afragen Iām trying to run phpunit in the IDE on Windows, so Iām trying to do something very different from what you have done.
Hi all (@clay included). Iām running Local by Flywheel v3.3.0 on Windows. Iāve created a site in Local by Flywheel, and would now like to use PHPUnit with it. Are the instructions in this post still the preferred way to do so? The only reason I ask is because when the post was created, this qualifier was added:
Note! This is an involved tutorial! We plan on drastically streamlining the PHPUnit experience with Local in future versions.
Thanks.
This depends on the version of Local you are using. Older versions installed the web/db server in a virtual machine (VirtualBox) while newer versions abandoned the virtual machine for installing the server directly on your native OS.
If you are using the latest and greatest then these instructions wonāt work, but you could try @afragenās recommendation above: Local + PHPUnit + PhpStorm. I havenāt personally tried this method yet.
@wpalchemy - Curious if you ever made headway on this?
Iāve just spent a few minutes investigating. From what I see it looks like Local is similar to a normal WAMP stack under the pretty GUI.
You can find the actual application files at a path something like this:
C:\Program Files (x86)\Local
If you drill down into \resources\extraResources\lightning-services
youāll see the a number of folders representing: mariadb, mysql, nginx, php, and mailhog.
You can find MySQLās binaries somewhere like:
C:\Program Files (x86)\Local\resources\extraResources\lightning-services\mysql-8.0.16+3\bin\win64\bin
I think one could interact with these directly rather than through Local (though Iām sure that isnāt supported )ā¦If I dive into it more Iāll post a separate thread as I donāt want to hijack this one.
This is a great article and everything worked for me, but I donāt understand how to, after setting up phpunit and phpstorm, then start testing wordpress-develop
. I tried deleting everything in the public
folder and then checking out wordpress-develop
into the public
folder, but then i just get a ton of errors. What location would i checkout wordpress-develop
into to get it to work with this article? Iām using Local 3.3.0
Thanks!
After spending weeks of trying to get the new version of Local to actually run PHPUnit in PHPStorm, I finally gave up and reverted back to the docker-based version.
Itās super frustrating that there is no apparent way to do this anymore. I get that itās localā¦ish, but the script that runs in the āshellā appears to do some fancy things that are necessary for the environment.
I have managed to get PHPUnit running thanks to @afragen but Iāve hit dead-end after dead-end in trying to get PHPUnit to run inside PHPStorm in this environment.
Does anyone have any advice on how to do this? @clay, perhaps?
My current process is still the same as detailed here: Local + PHPUnit + PhpStorm
I was able to get the ports extension to work, but I had to clone it, and run it directly. You can follow the ādevelopingā directions here to get it to work:
I was pleasantly surprised to find it worked perfectly on 3.2.1