phpactor / phpunit-extension
Various integrations for PHPUnit
Installs: 1 979
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 1
Type:phpactor-extension
Requires
- php: ^7.3 || ^8.0
- phpactor/code-transform-extension: ^0.2.1
- phpactor/container: ^2.0.0
- phpactor/test-utils: ^1.1.3
- phpactor/worse-reflection-extension: ^0.2.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.17
- phpspec/prophecy-phpunit: ^2.0
- phpstan/phpstan: ~0.12.0
- phpunit/phpunit: ^9.0
- rector/rector: 0.8.52
This package is auto-updated.
Last update: 2024-11-06 23:27:10 UTC
README
PHPUnit integration for Phpactor
Features
- Type inference for
Assert::instanceOf(Foo::class, 'bar')
(for both member and static versions). - Generate new test classes
Installation
Install Phpactor with the Phpactor binary:
$ /path/to/phpactor extension:install phpactor/phpunit-extension
You can also install extensions from your editor. See extensions for more details.
Configuration and Usage
Test Navigation
Phpactor allows you to jump to related files, just add the following configuration to jump from your standard source code to the test:
{ "navigator.destinations": { "source": "lib\/<kernel>Test.php" "test": "tests\/Unit\/<kernel>Test.php" }, }
See Jump to related file for more information.
Test Auto Creation
When jumping to a file which does not exist, Phpactor can offer to create a
file for you. This plugin includes a simple phpunit
class generator,
configure (promted) auto-creation as follows:
{ "navigator.autocreate": { "source": "default", "test": "phpunit" } }
TODO
- RPC handlers to run PHPUnit, jump to failing tests?
Contributing
This package is open source and welcomes contributions! Feel free to open a pull request on this repository.
Support
- Create an issue on the main Phpactor repository.
- Join the
#phpactor
channel on the Slack Symfony Devs channel.