Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitadafb8b

Browse files
committed
try to work around the LogicalNot(ResponseHeaderSame) behaviour
1 parentf9660cc commitadafb8b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Test/BrowserKitAssertionsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static function assertResponseHeaderSame(string $headerName, string $expe
7979

8080
publicstaticfunctionassertResponseHeaderNotSame(string$headerName,string$expectedValue,string$message =''):void
8181
{
82-
self::assertThatForResponse(newLogicalNot(newResponseConstraint\ResponseHeaderSame($headerName,$expectedValue)),$message);
82+
self::assertThatForResponse(newLogicalNot(newResponseConstraint\ResponseHeaderSame($headerName,$expectedValue,true)),$message);
8383
}
8484

8585
publicstaticfunctionassertResponseHasCookie(string$name,string$path ='/',string$domain =null,string$message =''):void

‎src/Symfony/Component/HttpFoundation/Test/Constraint/ResponseHeaderSame.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ final class ResponseHeaderSame extends Constraint
1818
{
1919
privatestring$headerName;
2020
privatestring$expectedValue;
21+
privatebool$logicalNot;
2122
private ?string$actualValue =null;
2223

23-
publicfunction__construct(string$headerName,string$expectedValue)
24+
publicfunction__construct(string$headerName,string$expectedValue,bool$logicalNot =false)
2425
{
2526
$this->headerName =$headerName;
2627
$this->expectedValue =$expectedValue;
28+
$this->logicalNot =$logicalNot;
2729
}
2830

2931
publicfunctiontoString():string
@@ -34,7 +36,7 @@ public function toString(): string
3436
$output .=sprintf(', header "%s" is not set',$this->headerName);
3537
}
3638

37-
if (null !==$this->actualValue) {
39+
if (null !==$this->actualValue && !$this->logicalNot) {
3840
$output .=sprintf(', value of header "%s" is "%s"',$this->headerName,$this->actualValue);
3941
}
4042

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp