Avoid broken inspector cli version by pinning (#98)

This commit is contained in:
Christopher Hertel 2025-10-07 00:42:26 +02:00 • committed by GitHub
commit f0807f149e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,12 +17,20 @@ use Symfony\Component\Process\Process;
abstract class InspectorSnapshotTestCase extends TestCase abstract class InspectorSnapshotTestCase extends TestCase
{ {
private const INSPECTOR_VERSION = '0.16.8';
#[DataProvider('provideMethods')] #[DataProvider('provideMethods')]
public function testResourcesListOutputMatchesSnapshot(string $method): void public function testResourcesListOutputMatchesSnapshot(string $method): void
{ {
$process = Process::fromShellCommandline( $process = (new Process([
\sprintf('npx @modelcontextprotocol/inspector --cli php %s --method %s', $this->getServerScript(), $method) 'npx',
)->mustRun(); \sprintf('@modelcontextprotocol/inspector@%s', self::INSPECTOR_VERSION),
'--cli',
'php',
$this->getServerScript(),
'--method',
$method,
]))->mustRun();
$output = $process->getOutput(); $output = $process->getOutput();
$snapshotFile = $this->getSnapshotFilePath($method); $snapshotFile = $this->getSnapshotFilePath($method);