Download the PHP package ghostwriter/psalm-plugin-tester without Composer
On this page you can find all versions of the php package ghostwriter/psalm-plugin-tester. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ghostwriter/psalm-plugin-tester
More information about ghostwriter/psalm-plugin-tester
Files in ghostwriter/psalm-plugin-tester
Package psalm-plugin-tester
Short Description Provides a framework for testing Psalm plugins
License BSD-3-Clause
Homepage https://github.com/ghostwriter/psalm-plugin-tester
Informations about the package psalm-plugin-tester
Psalm Sandbox
work in progress
[!WARNING]
This project is not finished yet, work in progress.
Installation
You can install the package via composer:
Usage
You can create a test for your plugin by extending the AbstractPsalmSandboxTestCase
class.
eg. tests/Unit/ExamplePluginTest.php
You can then run your tests using PHPUnit.
Plugin Development
Example Directory Structure
Your plugin should have the following directory structure:
Example Fix
Test
When you run vendor/bin/psalm --alter
, it will automatically fix the code for you.
To create a Fix
test, you need to create a file in the tests/Fixture/{PsalmIssueType}
directory.
The file name should be prefixed with fix-
and any unique identifier, e.g. fix-0001.php.inc
.
The file MUST use --FIX--
to separate the before
and after
code.
The file should be structured as follows:
Example Report
Test
When you run vendor/bin/psalm
, it will report the issue in your code.
To create a Report
test, you need to create a file in the tests/Fixture/{PsalmIssueType}
directory.
The file name should be prefixed with report-
and any unique identifier, e.g. report-0001.php.inc
.
The file should be structured as follows:
Example Suppress
Test
You can suppress the issue in your code by adding the @psalm-suppress
annotation, adding suppressions to your psalm.xml
file, or using a plugin.
To create a Suppress
test, you need to create a file in the tests/Fixture/{PsalmIssueType}
directory.
The file name should be prefixed with suppress-
and any unique identifier, e.g. suppress-0001.php.inc
.
The file should be structured as follows:
Testing
Changelog
Please see CHANGELOG.md for more information what has changed recently.
Security
If you discover any security related issues, please email [email protected]
instead of using the issue tracker.
Support
Thank you
To acknowledge the efforts of those who create and maintain valuable projects for the community.
Thank you to Bruce Weirdan for the original psalm/codeception-psalm-module
that served as the starting point for my work.
Thank you to Matt Brown, the creator of vimeo/psalm
, a fantastic tool for static analysis in PHP.
Special thanks to @orklah for maintaining vimeo/psalm
, ensuring its continuous improvement and functionality.
Credits
License
The BSD-3-Clause. Please see License File for more information.
All versions of psalm-plugin-tester with dependencies
ext-simplexml Version *
composer-runtime-api Version >=2.2.2
composer/semver Version ^3.3.2
ghostwriter/collection Version ^1.3.2
ghostwriter/config Version ^0.4.1
ghostwriter/container Version ^1.6
ghostwriter/event-dispatcher Version ^1.5.0
ghostwriter/json Version ^1.1
ghostwriter/option Version ^1.5.1
ghostwriter/result Version ^1.3
phpunit/phpunit Version ^10.2.7