Skip to content

Commit de8084d

Browse files
eduPHPtaylorotwell
authored andcommitted
Flip expected and actual value on assertCookie (#19495)
Problem: Test: ``` $response->assertCookie("somecookie", 'expected'); ``` Controller: ´´´ Cookie::queue('somecookie', 'actual value', $days); ´´´ phpunit ´´´ There was 1 failure: 1) Tests\Feature\LifetimeCookiesTest::by_accessing_the_affiliation_link_a_cookie_must_be_stored Cookie [somecookie] was found, but value [actual] does not match [expected]. Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'actual' +'expected' ´´´ Solution: Flip expected and actual values
1 parent 42f0a50 commit de8084d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Foundation/Testing/TestResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function assertCookie($cookieName, $value = null, $encrypted = true)
161161
? app('encrypter')->decrypt($cookieValue) : $cookieValue;
162162

163163
PHPUnit::assertEquals(
164-
$actual, $value,
164+
$value, $actual,
165165
"Cookie [{$cookieName}] was found, but value [{$actual}] does not match [{$value}]."
166166
);
167167

0 commit comments

Comments
 (0)