Skip to content

Commit facab7a

Browse files
Nicolas Apprioufabpot
Nicolas Appriou
authored andcommitted
[FrameworkBundle][HttpFoundation] reduce response constraints verbosity
1 parent cb43dc7 commit facab7a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Test/BrowserKitAssertionsTrait.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@
2828
*/
2929
trait BrowserKitAssertionsTrait
3030
{
31-
public static function assertResponseIsSuccessful(string $message = ''): void
31+
public static function assertResponseIsSuccessful(string $message = '', bool $verbose = true): void
3232
{
33-
self::assertThatForResponse(new ResponseConstraint\ResponseIsSuccessful(), $message);
33+
self::assertThatForResponse(new ResponseConstraint\ResponseIsSuccessful($verbose), $message);
3434
}
3535

36-
public static function assertResponseStatusCodeSame(int $expectedCode, string $message = ''): void
36+
public static function assertResponseStatusCodeSame(int $expectedCode, string $message = '', bool $verbose = true): void
3737
{
38-
self::assertThatForResponse(new ResponseConstraint\ResponseStatusCodeSame($expectedCode), $message);
38+
self::assertThatForResponse(new ResponseConstraint\ResponseStatusCodeSame($expectedCode, $verbose), $message);
3939
}
4040

4141
public static function assertResponseFormatSame(?string $expectedFormat, string $message = ''): void
4242
{
4343
self::assertThatForResponse(new ResponseConstraint\ResponseFormatSame(self::getRequest(), $expectedFormat), $message);
4444
}
4545

46-
public static function assertResponseRedirects(?string $expectedLocation = null, ?int $expectedCode = null, string $message = ''): void
46+
public static function assertResponseRedirects(?string $expectedLocation = null, ?int $expectedCode = null, string $message = '', bool $verbose = true): void
4747
{
48-
$constraint = new ResponseConstraint\ResponseIsRedirected();
48+
$constraint = new ResponseConstraint\ResponseIsRedirected($verbose);
4949
if ($expectedLocation) {
5050
if (class_exists(ResponseConstraint\ResponseHeaderLocationSame::class)) {
5151
$locationConstraint = new ResponseConstraint\ResponseHeaderLocationSame(self::getRequest(), $expectedLocation);
@@ -100,9 +100,9 @@ public static function assertResponseCookieValueSame(string $name, string $expec
100100
), $message);
101101
}
102102

103-
public static function assertResponseIsUnprocessable(string $message = ''): void
103+
public static function assertResponseIsUnprocessable(string $message = '', bool $verbose = true): void
104104
{
105-
self::assertThatForResponse(new ResponseConstraint\ResponseIsUnprocessable(), $message);
105+
self::assertThatForResponse(new ResponseConstraint\ResponseIsUnprocessable($verbose), $message);
106106
}
107107

108108
public static function assertBrowserHasCookie(string $name, string $path = '/', ?string $domain = null, string $message = ''): void

0 commit comments

Comments
 (0)