From 9b077c7a8ec96050f3a3b73219c8b904d3d83ab0 Mon Sep 17 00:00:00 2001 From: Jarryd Tilbrook Date: Mon, 20 Oct 2025 17:40:56 +0800 Subject: [PATCH] feat(lang): add neotest config for PHP tests (#5958) ## Description Similar to some other languages (this closely follows the Go lang extra), this adds neotest runners for the major PHP test runners: PHPUnit and Pest. Both work together, trying to use Pest if available and falling back to PHPUnit which is a decent approach for the PHP ecosystem. I read CONTRIBUTING.md which differs from the way the Go lang extra has implemented a neotest adapters and opted to follow that instead. Ie. adapters have been added as dependencies instead of a separate spec with `lazy=true`. Let me know if you want that changed. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/php.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/php.lua b/lua/lazyvim/plugins/extras/lang/php.lua index 04469223..98fffdb0 100644 --- a/lua/lazyvim/plugins/extras/lang/php.lua +++ b/lua/lazyvim/plugins/extras/lang/php.lua @@ -83,4 +83,21 @@ return { }, }, }, + + { + "nvim-neotest/neotest", + optional = true, + dependencies = { + "V13Axel/neotest-pest", + "olimorris/neotest-phpunit", + }, + opts = { + adapters = { + "neotest-pest", + ["neotest-phpunit"] = { + root_ignore_files = { "tests/Pest.php" }, + }, + }, + }, + }, }