![]() (Name the configuration to your taste.)Īll done!!! Now I was able to run the tests simply by selecting the new run configuration defined in the dropdown, and clicking the Run button in the toolbar. we will happily accept your GitHub pull requests for. ![]() Now it was just a matter of adding the directory where the tests reside. PhpStorm supports PHPUnit, Codeception, Behat, and PHPSpec test frameworks out. Once the dialog opened I clicked the “+” to add a run configuration, and select the PHPUnit type. Now I had to add a Run/Debug Configuration for the project. I did this by clicking on the toolbar dropdown and selecting Edit Configurations. The central pane is a fully-functional editor where the results of resolving conflicts are displayed. The right pane shows the read-only version checked in to the repository. This tool consists of three panes: The left pane shows the read-only local copy. To start I needed to inform the IDE where to find the Composer autoload file and leverage the awesome PSR-0 goodness to autoload PHPUnit in the /vendor directory. To do this I open the Settings via the icon on the toolbar, or by using the File->Settings menu item, or hitting the Ctrl+Alt+S keyboard shortcut. Then in the Project Settings (top section) I expanded PHP to get the PHPUnit dialog. PhpStorm provides a tool for resolving conflicts locally. The way OpenCFP was set up, using Composer, meant that PHPUnit was already placed in the /vendor directory as a requirement in the composer.json. So rather than taking the lazy way out and using the PHPUnit already installed globally on my system, I wanted to use the latest PHPUnit within the project. This requires 2 setup steps in PHPStorm. (I’ll do the same for Zend Studio in another post later.) (I have a pull requests pending, and another to submit. Love open source!)įor my CFP I wanted a few more fields of information than the “out of the box” setup, so I quickly added them to the app. However, doing this meant the included unit tests would fail. But wait, I hadn’t run the unit tests yet! I realized immediately how spoiled I had become with today’s modern frameworks with a testing method built in. This little project did not have that luxury, so I would need to run the tests the old fashioned way, or let an IDE do it for me. I decided to configure PHPStorm do it. To launch the call for papers for the SunshinePHP Developer Conference it was a pleasure to use the OpenCFP project as a starting point rather than creating the entire thing from scratch. While the project is still a “beta” with a few wrinkles to get ironed out, it’s still a pretty nice effort. ![]() ![]() However, with the right steps it’s actually pretty simple. Installing PHPUnit within a project via Composer, then running tests through PHPStorm is not an intuitive process. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |