← 输入框|github.com|刷新
Skip to content

Commit ca82f41

Browse files
committed
test(docs): use the IDResponse model name from API 1.48
API 1.48 renamed IdResponse to IDResponse. Pick the generated class that exists, since class files are looked up case-sensitively on Linux.
1 parent b140117 commit ca82f41

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎tests/DocumentationExamplesTest.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,11 @@ public function testExecCreatesAndStartsWithConsistentTtySettings(): void
285285
public function testExecChecksTheCommandExitCode(): void
286286
{
287287
$client = $this->client(static fn () => new Response(200, ['Content-Type' => 'application/json'], '{"Running":false,"ExitCode":7}'));
288-
$exec = new \Docker\API\Model\IdResponse();
288+
// API 1.48 renamed IdResponse to IDResponse; class names are case-sensitive on Linux.
289+
$model = is_file(\dirname((new \ReflectionClass(\Docker\API\Client::class))->getFileName()).'/Model/IDResponse.php')
290+
? 'Docker\\API\\Model\\IDResponse'
291+
: 'Docker\\API\\Model\\IdResponse';
292+
$exec = new $model();
289293
$exec->setId('example-exec');
290294
$this->expectException(\RuntimeException::class);
291295
$this->expectExceptionMessage('exit status 7');

0 commit comments

Comments
 (0)