1
0
Fork 0
mirror of https://github.com/pnx/neotest-phpunit synced 2026-06-16 03:54:55 +02:00
This commit is contained in:
Henrik Hautakoski 2025-09-23 19:50:41 +02:00
parent 1429445746
commit 8cbe882c2f
5 changed files with 89 additions and 124 deletions

View file

@ -1,15 +1,14 @@
# neotest-pest
# neotest-phpunit
This plugin provides a [Pest](https://pestphp.com) adapter for the [Neotest](https://github.com/nvim-neotest/neotest) framework.
This plugin provides a [PHPUnit](https://phpunit.de) adapter for the [Neotest](https://github.com/nvim-neotest/neotest) framework.
This is a fork of `neotest-pest` originally by [@theutz](https://github.com/theutz/neotest-pest), with some fixes and updates:
This is a fork of `neotest-pest` originally by [@V13Axel](https://github.com/V13Axel/neotest-pest) modified for phpunit
- Updated to work with [Pest](https://pestphp.com) 2.0
- Support for (and automatic detection of) Laravel Sail
- Note: This also moves junit output files into `storage/app/`
- Note: This also moves phpunit output files into `storage/app/`
- Parallel testing support
:warning: _Ive only focused on making this work for me. Please test against your Pest tests_ :warning:
:warning: _Ive only focused on making this work for me. Please test against your phpunit tests_ :warning:
## :package: Installation
@ -22,13 +21,13 @@ Here's an example using lazy.nvim:
'nvim-neotest/neotest',
dependencies = {
...,
'V13Axel/neotest-pest',
'pnx/neotest-phpunit',
},
config = function()
require('neotest').setup({
...,
adapters = {
require('neotest-pest'),
require('neotest-phpunit'),
}
})
end
@ -48,13 +47,13 @@ adapters = {
-- -- Default: { "vendor", "node_modules" }
ignore_dirs = { "vendor", "node_modules" }
-- Ignore any projects containing "phpunit-only.tests"
-- Ignore any projects containing "no_phpunit"
-- -- Default: {}
root_ignore_files = { "phpunit-only.tests" },
root_ignore_files = { "no_phpunit" },
-- Specify suffixes for files that should be considered tests
-- -- Default: { "Test.php" }
test_file_suffixes = { "Test.php", "_test.php", "PestTest.php" },
test_file_suffixes = { "Test.php", "_test.php" },
-- Sail not properly detected? Explicitly enable it.
-- -- Default: function() that checks for sail presence
@ -71,16 +70,12 @@ adapters = {
-- Custom pest binary.
-- -- Default: function that checks for sail presence
pest_cmd = "vendor/bin/pest",
phpunit_cmd = "vendor/bin/phpunit",
-- Run N tests in parallel, <=1 doesn't pass --parallel to pest at all
-- Run N tests in parallel, <=1 doesn't pass --parallel to phpunit at all
-- -- Default: 0
parallel = 16
-- Enable ["compact" output printer](https://pestphp.com/docs/optimizing-tests#content-compact-printer)
-- -- Default: false
compact = false,
-- Set a custom path for the results XML file, parsed by this adapter
--
------------------------------------------------------------------------------------
@ -127,7 +122,7 @@ To test the full test suite run `lua require('neotest').run.run({ suite = true }
## :gift: Contributing
I'm just one guy, maintaining this in my spare time and when I can get to it. Please raise a PR if you are interested in adding new functionality or fixing any bugs. When submitting a bug, please include an example test that I can test against.
Please raise a PR if you are interested in adding new functionality or fixing any bugs. When submitting a bug, please include an example test that I can test against.
To trigger the tests for the adapter, run:
@ -137,4 +132,4 @@ To trigger the tests for the adapter, run:
## :clap: Prior Art
This package is a fork of [neotest-pest](https://github.com/theutz/neotest-pest) by [@theutz](https://github.com/olimorris), which relied _heavily_ on [olimorris/neotest-phpunit](https://github.com/olimorris/neotest-phpunit) by [@olimorris](https://github.com/olimorris).
This package is a fork of [neotest-pest](https://github.com/V13Axel/neotest-pest) by [@V13Axel](https://github.com/V13Axel) which is a fork of [neotest-pest](https://github.com/theutz/neotest-pest) by [@theutz](https://github.com/olimorris), which relied _heavily_ on [olimorris/neotest-phpunit](https://github.com/olimorris/neotest-phpunit) by [@olimorris](https://github.com/olimorris).