Skip to content

Commit a184a18

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: [Security][Tests] Update functional tests to better reflect end-user scenarios [HttpClient] Fix deprecation on PHP 8.3
2 parents ff08e9e + 1f386a3 commit a184a18

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ public function testCustomFailureHandler()
126126

127127
$client->request('POST', '/firewall1/login', [
128128
'_username' => '[email protected]',
129-
'_password' => '',
129+
'_password' => 'wrong',
130130
]);
131131
$this->assertResponseRedirects('http://localhost/firewall1/login');
132132

133133
$client->request('POST', '/firewall1/dummy_login', [
134134
'_username' => '[email protected]',
135-
'_password' => '',
135+
'_password' => 'wrong',
136136
]);
137137
$this->assertResponseRedirects('http://localhost/firewall1/dummy_login');
138138
}

src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public function testFormLoginWithInvalidCsrfToken($options)
6868
});
6969

7070
$form = $client->request('GET', '/login')->selectButton('login')->form();
71+
$form['user_login[username]'] = 'johannes';
72+
$form['user_login[password]'] = 'test';
7173
$form['user_login[_token]'] = '';
7274
$client->submit($form);
7375

src/Symfony/Component/HttpClient/NativeHttpClient.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,11 @@ private static function createRedirectResolver(array $options, string $host, str
404404
$redirectHeaders['no_auth'] = array_filter($redirectHeaders['no_auth'], $filterContentHeaders);
405405
$redirectHeaders['with_auth'] = array_filter($redirectHeaders['with_auth'], $filterContentHeaders);
406406

407-
stream_context_set_option($context, ['http' => $options]);
407+
if (\PHP_VERSION_ID >= 80300) {
408+
stream_context_set_options($context, ['http' => $options]);
409+
} else {
410+
stream_context_set_option($context, ['http' => $options]);
411+
}
408412
}
409413
}
410414

0 commit comments

Comments
 (0)