PHPT tests support
If you are working on a custom PHP extension or want to contribute to the PHP core, you can test your code by using .phpt tests. These tests are written in PHP and comprise a set of PHP scripts and additional information divided into sections.
At the bare minimum, a PHPT test must contain the TEST, FILE, and EXPECT sections.
Completion for PHPT section names
PhpStorm will highlight the PHPT sections in a .phpt file, and provide you with auto-completion Ctrl+Space for their names:
Code injection in PHPT sections
PhpStorm will automatically inject the PHP language inside the FILE
, SKIPIF
, FILEEOF
, CLEAN
sections, and the INI language — inside the INI
and ENV
sections:
Code navigation in PHPT sections
In _EXTERNAL
sections, such as FILE_EXTERNAL
or EXPECT_EXTERNAL
, you can navigate to the referenced file. Place the caret at the reference and press Ctrl+B. Alternatively, Ctrl+Click the referenced file to open it in the editor.