Skip to content

Commit

Permalink
Fix cookie sessions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evaisse committed Jun 29, 2015
1 parent 987e9e7 commit 0a9bb24
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class Request extends HttpRequest
public function getContent($asResource = false)
{
if ($asResource) {
$resource = fopen("php://temp", "w+");
$resource = fopen("php://temp/" . uniqid(), "w+");
fwrite($resource, $this->content);
return $resource; // TODO: Change the autogenerated stub
return $resource;
} else {
return $this->content;
}
Expand Down
8 changes: 8 additions & 0 deletions Service/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ public function __construct(ContainerInterface $container)
* @return CookieJar
*/
public function getDefaultCookieJar()
{
return $this->createCookieJar();
}

/**
* @return SessionCookieJar
*/
protected function createCookieJar()
{
return new SessionCookieJar();
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/CookieSessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testCookieStore()
$i = (int)rand(0,100);
$j = (int)rand(0,100);

$cookieSession = $helper->createCookieSession();
$cookieSession = $helper->getDefaultCookieJar();

/*
* Sent a tmp cookie value
Expand Down

0 comments on commit 0a9bb24

Please sign in to comment.