PHPackages                             t3ide/php-lsp-test - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. t3ide/php-lsp-test

ActiveLibrary

t3ide/php-lsp-test
==================

PHPUnit-first LSP blackbox testing tools for PHP

v1.0.0(1mo ago)00MITPHPPHP ^8.3

Since Mar 22Pushed 1mo agoCompare

[ Source](https://github.com/t3ide/php-lsp-test)[ Packagist](https://packagist.org/packages/t3ide/php-lsp-test)[ RSS](/packages/t3ide-php-lsp-test/feed)WikiDiscussions public Synced 1mo ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

php-lsp-test
============

[](#php-lsp-test)

`php-lsp-test` is a lightweight test harness for Language Server Protocol (LSP) servers in PHP projects, built for reliable use with PHPUnit.

It is inspired by [`pytest-lsp`](https://github.com/openlawlibrary/pytest-lsp), but intentionally adapted to PHP and synchronous PHPUnit workflows instead of async pytest fixtures.

Goals
-----

[](#goals)

- Start and control real LSP server processes from tests
- Send and receive JSON-RPC messages over stdio
- Assert protocol behavior in unit, integration, and end-to-end scenarios
- Reproduce editor-like flows in a deterministic PHPUnit environment
- Surface actionable diagnostics when tests fail (stderr/stdout/log messages)

Installation
------------

[](#installation)

Add as a dev dependency:

```
composer require --dev t3ide/php-lsp-test
```

Quickstart (PHPUnit)
--------------------

[](#quickstart-phpunit)

Use `LanguageServerTestCase` to spin up and initialize a client quickly:

```
