Skip to content

Flip expected and actual value on assertCookie#19495

Merged
taylorotwell merged 1 commit intolaravel:5.4from
eduPHP:patch-1
Jun 6, 2017
Merged

Flip expected and actual value on assertCookie#19495
taylorotwell merged 1 commit intolaravel:5.4from
eduPHP:patch-1

Conversation

@eduPHP
Copy link
Copy Markdown
Contributor

@eduPHP eduPHP commented Jun 6, 2017

Problem:

Test:

    $response->assertCookie("somecookie", 'expected');

Controller:

Cookie::queue('somecookie', 'actual', $days);

phpunit

There was 1 failure:

1) Tests\Feature\CookiesTest::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

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
@taylorotwell taylorotwell merged commit de8084d into laravel:5.4 Jun 6, 2017
@taylorotwell
Copy link
Copy Markdown
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants