Avoid broken inspector cli version by pinning (#98)
This commit is contained in:
parent
345b94dfbb
commit
f0807f149e
1 changed files with 11 additions and 3 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue