Integrates atoum into PhpStorm.
Features :
By an entry on the run menu and on the right click menu.
You can run the tests from both the test file or the tested classe's file.
Your test file and tested file will automatically be save before running the test.
The default keyboard shortcut to execute the test is alt+shift+M.
From the tested class you can go to the test class by clicking on the icon on the left of the class,
or from a menu entry in navigation,
or by an entry bin the right click menu.
The default keyboard shortcut to switch file is alt+shift+K.
From the test class you can go to the tested class by clicking on the icon on the left of the class,
or from a menu entry in navigation,
or by an entry bin the right click menu.
The default keyboard shortcut to switch file is alt+shift+K.
You can also run the test on the project view. From here you can launch tests on an entire directory:
Atoum's test files are displayed with a different icon, like that you will easily differentiate them from other PHP files.
The plugin lets you run all your project's test suites inside PhpStorm. You can run them by selecting "run -> atoum - run all tests" (or with the default keyboard shortcut : alt+shift+V).
atoum will be launched without a directory or file parameter, so, you will need to add something like this in your .atoum.php
file in order to run all the tests : $runner->addTestsFromDirectory(__DIR__ . '/tests/units');
.
.atoum.phpstorm.php
If you want to customize the way tests are launched only when launched inside phpstorm, your can create a .atoum.phpstorm.php
file. If it exists, the file will be loaded with the -c
option.
For example:
// .atoum.phpstorm.php
$script->setMaxChildrenNumber(1);
atoum.php
If you want to customize the way tests are launched only when launched inside phpstorm, your can create add some conditions in your .atoum.php
file : the plugin exposes an environment variable called PHPSTORM
with value 1
.
For example:
// .atoum.php
if (getenv("PHPSTORM")) {
$script->setMaxChildrenNumber(1);
}
(this also works to launch test with a different version of php than the default)
In the project's directory, were create a file named php
. For example in a docker/bin
directory:
# docker/bin/php
docker run -v `pwd`:/var/www -w /var/www php:7 php $@
File -> Settings
Language & Frameworks -> PHP
+
PHP executable
. For example /home/user/tmp/test_php7/docker/bin/php
.Now, your tests will be executed inside a docker container.
File -> Settings
, then click on Plugins
Browse repositories
.jar
on the releases pagesFile -> Settings
, then click on Plugins
install from disk
button, then select to downloaded jaratoum phpstorm-plugin is released under the MIT License. See the bundled LICENSE file for details.