phpactor/phpunit-extension

Various integrations for PHPUnit

Installs: 1 980

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 1

Open Issues: 1

Type:phpactor-extension

0.1.4 2021-02-06 15:14 UTC

This package is auto-updated.

Last update: 2024-12-06 23:40:44 UTC


README

CI

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.