Skip to content

Commit 3392a3f

Browse files
committed
fix tests on Windows
1 parent 2b9a036 commit 3392a3f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Tests/DataCollector/HttpClientDataCollectorTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@ public function testItGeneratesCurlCommandsAsExpected()
182182
$collectedData = $sut->getClients();
183183
self::assertCount(1, $collectedData['http_client']['traces']);
184184
$curlCommand = $collectedData['http_client']['traces'][0]['curlCommand'];
185-
self::assertEquals("curl \\
185+
self::assertEquals(sprintf('curl \\
186186
--compressed \\
187187
--request GET \\
188-
--url 'https://symfony.com/releases.json' \\
189-
--header 'Accept: */*' \\
190-
--header 'Accept-Encoding: gzip' \\
191-
--header 'User-Agent: Symfony HttpClient/Native'", $curlCommand
188+
--url %1$shttps://symfony.com/releases.json%1$s \\
189+
--header %1$sAccept: */*%1$s \\
190+
--header %1$sAccept-Encoding: gzip%1$s \\
191+
--header %1$sUser-Agent: Symfony HttpClient/Native%1$s', '\\' === \DIRECTORY_SEPARATOR ? '"' : "'"), $curlCommand
192192
);
193193
}
194194

@@ -208,13 +208,13 @@ public function testItDoesNotFollowRedirectionsWhenGeneratingCurlCommands()
208208
$collectedData = $sut->getClients();
209209
self::assertCount(1, $collectedData['http_client']['traces']);
210210
$curlCommand = $collectedData['http_client']['traces'][0]['curlCommand'];
211-
self::assertEquals("curl \\
211+
self::assertEquals(sprintf('curl \\
212212
--compressed \\
213213
--request GET \\
214-
--url 'http://symfony.com/releases.json' \\
215-
--header 'Accept: */*' \\
216-
--header 'Accept-Encoding: gzip' \\
217-
--header 'User-Agent: Symfony HttpClient/Native'", $curlCommand
214+
--url %1$shttp://symfony.com/releases.json%1$s \\
215+
--header %1$sAccept: */*%1$s \\
216+
--header %1$sAccept-Encoding: gzip%1$s \\
217+
--header %1$sUser-Agent: Symfony HttpClient/Native%1$s', '\\' === \DIRECTORY_SEPARATOR ? '"' : "'"), $curlCommand
218218
);
219219
}
220220

0 commit comments

Comments
 (0)