Skip to content

Commit

Permalink
merged branch Tobion/assert-fix (PR #3063)
Browse files Browse the repository at this point in the history
Commits
-------

1728493 made the assertions in the RequestTest more explicit and improved PHPDoc

Discussion
----------

made the assertions in the RequestTest more explicit and improved PHPDoc

as discussed in 4f1edb5#comments
  • Loading branch information
fabpot committed Jan 9, 2012
2 parents 0336bdc + 1728493 commit 21993aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/Symfony/Component/HttpFoundation/Request.php
Expand Up @@ -641,7 +641,7 @@ public function getUriForPath($path)
* It builds a normalized query string, where keys/value pairs are alphabetized
* and have consistent escaping.
*
* @return string A normalized query string for the Request
* @return string|null A normalized query string for the Request
*
* @api
*/
Expand Down Expand Up @@ -923,7 +923,7 @@ public function isNoCache()
*
* @param array $locales An array of ordered available locales
*
* @return string The preferred locale
* @return string|null The preferred locale
*
* @api
*/
Expand Down Expand Up @@ -1037,6 +1037,8 @@ public function isXmlHttpRequest()
* Splits an Accept-* HTTP header.
*
* @param string $header Header to split
*
* @return array Array indexed by the values of the Accept-* header in preferred order
*/
public function splitHttpAcceptHeader($header)
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Symfony/Tests/Component/HttpFoundation/RequestTest.php
Expand Up @@ -718,8 +718,8 @@ public function testGetPathInfo()
public function testGetPreferredLanguage()
{
$request = new Request();
$this->assertEquals('', $request->getPreferredLanguage());
$this->assertEquals('', $request->getPreferredLanguage(array()));
$this->assertNull($request->getPreferredLanguage());
$this->assertNull($request->getPreferredLanguage(array()));
$this->assertEquals('fr', $request->getPreferredLanguage(array('fr')));
$this->assertEquals('fr', $request->getPreferredLanguage(array('fr', 'en')));
$this->assertEquals('en', $request->getPreferredLanguage(array('en', 'fr')));
Expand Down Expand Up @@ -795,10 +795,10 @@ public function testGetRequestFormat()
$this->assertEquals('html', $request->getRequestFormat());

$request = new Request();
$this->assertEquals(null, $request->getRequestFormat(null));
$this->assertNull($request->getRequestFormat(null));

$request = new Request();
$this->assertEquals(null, $request->setRequestFormat('foo'));
$request->setRequestFormat('foo');
$this->assertEquals('foo', $request->getRequestFormat(null));
}

Expand Down

0 comments on commit 21993aa

Please sign in to comment.