Skip to content

Commit

Permalink
Merge branch '3.2'
Browse files Browse the repository at this point in the history
* 3.2:
  [Console] Fix too strict test
  [FrameworkBundle] Execute the PhpDocExtractor earlier
  [validator] Updated croatian translation
  Update DebugHandlersListener.php
  ignore invalid cookies expires date format
  [Console] SfStyleTest: Remove COLUMN env on tearDown
  [TwigBundle] Fix the name of the cache warming test class
  [Console] Fix TableCell issues with decoration
  Add missing pieces in the upgrade guide to 3.0
  • Loading branch information
nicolas-grekas committed Jan 31, 2017
2 parents 57b1071 + 394a247 commit 0e56d18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ private static function parseDate($dateValue)
if (false !== $date = date_create($dateValue, new \DateTimeZone('GMT'))) {
return $date->format('U');
}

throw new \InvalidArgumentException(sprintf('Could not parse date "%s".', $dateValue));
}

/**
Expand Down
7 changes: 4 additions & 3 deletions Tests/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ public function testFromStringThrowsAnExceptionIfCookieIsNotValid()
Cookie::fromString('foo');
}

public function testFromStringThrowsAnExceptionIfCookieDateIsNotValid()
public function testFromStringIgnoresInvalidExpiresDate()
{
$this->setExpectedException('InvalidArgumentException');
Cookie::fromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT');
$cookie = Cookie::fromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT');

$this->assertFalse($cookie->isExpired());
}

public function testFromStringThrowsAnExceptionIfUrlIsNotValid()
Expand Down

0 comments on commit 0e56d18

Please sign in to comment.