Skip to content

Commit b3b9b70

Browse files
author
Robin Chalas
committed
Merge branch '4.4' into 5.0
* 4.4: (38 commits) reset the kernel cache after each test [HttpKernel] Ability to define multiple kernel.reset tags [Routing] Continue supporting single colon in object route loaders [FWBundle] Remove unused parameter [Intl] [Workflow] fixes English grammar typos [Filesystem] [Serializer] fixes English grammar typo mailer: mailchimp bridge is throwing undefined index _id when setting message id in mandrill http transport has_roles should be is_granted in upgrade files [HttpClient] Fix early cleanup of pushed HTTP/2 responses skip test on incompatible PHP versions [HttpKernel] Don't cache "not-fresh" state [FrameworkBundle][Cache] Don't deep-merge cache pools configuration [Messenger] Adding exception to amqp transport in case amqp ext is not installed [SecurityBundle] Don't require a user provider for the anonymous listener [Monolog Bridge] Fixed accessing static property as non static. Improve Symfony description [Mailer] Add UPGRADE entries about Envelope and MessageEvent [FrameworkBundle] fix leftover mentioning "secret:" processor Add DateTimeZoneNormalizer into Dependency Injection [Messenger] Error when specified default bus is not among the configured ...
2 parents 0583977 + 3ff9c49 commit b3b9b70

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

HttpClient/Test/Fixtures/web/index.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,27 @@
155155
usleep(500);
156156
}
157157
exit;
158+
159+
case '/json':
160+
header("Content-Type: application/json");
161+
echo json_encode([
162+
'documents' => [
163+
['id' => '/json/1'],
164+
['id' => '/json/2'],
165+
['id' => '/json/3'],
166+
],
167+
]);
168+
exit;
169+
170+
case '/json/1':
171+
case '/json/2':
172+
case '/json/3':
173+
header("Content-Type: application/json");
174+
echo json_encode([
175+
'title' => $vars['REQUEST_URI'],
176+
]);
177+
178+
exit;
158179
}
159180

160181
header('Content-Type: application/json', true);

HttpClient/Test/HttpClientTestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
*/
2525
abstract class HttpClientTestCase extends TestCase
2626
{
27-
private static $server;
28-
2927
public static function setUpBeforeClass(): void
3028
{
3129
TestHttpServer::start();

HttpClient/Test/TestHttpServer.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,22 @@
1919
*/
2020
class TestHttpServer
2121
{
22-
private static $server;
22+
private static $started;
2323

2424
public static function start()
2525
{
26-
if (null !== self::$server) {
26+
if (self::$started) {
2727
return;
2828
}
2929

3030
$finder = new PhpExecutableFinder();
3131
$process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', '127.0.0.1:8057']));
3232
$process->setWorkingDirectory(__DIR__.'/Fixtures/web');
33-
$process->setTimeout(300);
3433
$process->start();
3534

36-
self::$server = new class() {
37-
public $process;
38-
39-
public function __destruct()
40-
{
41-
$this->process->stop();
42-
}
43-
};
44-
45-
self::$server->process = $process;
46-
35+
register_shutdown_function([$process, 'stop']);
4736
sleep('\\' === \DIRECTORY_SEPARATOR ? 10 : 1);
37+
38+
self::$started = true;
4839
}
4940
}

0 commit comments

Comments
 (0)