Skip to content

Commit edcd627

Browse files
committed
bug #29004 [BrowserKit] Remove undefined variable $str (samnela)
This PR was merged into the 4.2-dev branch. Discussion ---------- [BrowserKit] Remove undefined variable $str | Q | A | ------------- | --- | Branch? | master <!-- see below --> | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | no <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | no <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- 4b3fdd6 [BrowserKit] Remove undefined variable
2 parents b15b171 + 4b3fdd6 commit edcd627

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Symfony/Component/BrowserKit/Cookie.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function __toString()
110110
}
111111

112112
if (null !== $this->samesite) {
113-
$str .= '; samesite='.$this->samesite;
113+
$cookie .= '; samesite='.$this->samesite;
114114
}
115115

116116
return $cookie;

src/Symfony/Component/BrowserKit/Tests/CookieTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public function testToString()
2929

3030
$cookie = new Cookie('foo', 'bar', 0, '/', '');
3131
$this->assertEquals('foo=bar; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; httponly', (string) $cookie);
32+
33+
$cookie = new Cookie('foo', 'bar', 2, '/', '', true, true, false, 'lax');
34+
$this->assertEquals('foo=bar; expires=Thu, 01 Jan 1970 00:00:02 GMT; path=/; secure; httponly; samesite=lax', (string) $cookie);
3235
}
3336

3437
/**

0 commit comments

Comments
 (0)