https://github.com/phpactor/phpunit-extension
PHPUnit Integration for Phpactor
https://github.com/phpactor/phpunit-extension
Last synced: 11 months ago
JSON representation
PHPUnit Integration for Phpactor
- Host: GitHub
- URL: https://github.com/phpactor/phpunit-extension
- Owner: phpactor
- License: mit
- Created: 2018-12-01T20:43:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-06T15:25:02.000Z (almost 5 years ago)
- Last Synced: 2025-01-09T23:51:29.005Z (about 1 year ago)
- Language: PHP
- Size: 21.5 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PHPUnit Integration
===================

PHPUnit integration for [Phpactor](https://github.com/phpactor/phpactor)
Features
--------
- [x] Type inference for `Assert::instanceOf(Foo::class, 'bar')` (for both
member and static versions).
- [x] Generate new test classes
Installation
------------
Install Phpactor with the Phpactor binary:
```php
$ /path/to/phpactor extension:install phpactor/phpunit-extension
```
You can also install extensions from your editor. See
[extensions](https://phpactor.github.io/phpactor/extensions.html) for more
details.
Configuration and Usage
-----------------------
### Test Navigation
Phpactor allows you to jump to related files, just add the following
[configuration](https://phpactor.github.io/phpactor/configuration.html) to
jump from your standard source code to the test:
```javascript
{
"navigator.destinations": {
"source": "lib\/Test.php"
"test": "tests\/Unit\/Test.php"
},
}
```
See [Jump to related
file](https://phpactor.github.io/phpactor/navigation.html#jump-to-or-generate-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:
```javascript
{
"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](https://github.com/phpactor/phpactor) repository.
- Join the `#phpactor` channel on the Slack [Symfony Devs](https://symfony.com/slack-invite) channel.