Skip to content

Commit

Permalink
Merge pull request Codeception#2242 from Naktibalda/iisue-2234
Browse files Browse the repository at this point in the history
Disabled CookieJar strict mode in Guzzle6 connector
  • Loading branch information
Naktibalda committed Aug 5, 2015
2 parents 2579bf3 726e90d commit 96e8582
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Connector/Guzzle6.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 312,6 @@ protected function extractCookies($host)
}
$jar[] = $setCookie;
}
return new CookieJar(true, $jar);
return new CookieJar(false, $jar);
}
}
8 changes: 7 additions & 1 deletion tests/data/app/controllers.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 198,10 @@ function GET() {
header('Content-Type:', true);
include __DIR__.'/view/content_type2.php';
}
}
}

class unsetCookie {
function GET() {
header('Set-Cookie: a=; Expires=Thu, 01 Jan 1970 00:00:01 GMT');
}
}
1 change: 1 addition & 0 deletions tests/data/app/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 37,7 @@
'/register' => 'register',
'/content-iso' => 'contentType1',
'/content-cp1251' => 'contentType2',
'/unset-cookie' => 'unsetCookie',
);

glue::stick($urls);
13 changes: 13 additions & 0 deletions tests/unit/Codeception/Module/PhpBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 361,17 @@ private function skipForOldGuzzle()
$this->markTestSkipped("Not for Guzzle <6");
}
}

/**
* @issue https://github.com/Codeception/Codeception/issues/2234
*/
public function testEmptyValueOfCookie()
{
//set cookie
$this->module->amOnPage('/cookies2');

$this->module->amOnPage('/unset-cookie');
$this->module->seeResponseCodeIs(200);
$this->module->dontSeeCookie('a');
}
}

0 comments on commit 96e8582

Please sign in to comment.