made the assertions in the RequestTest more explicit and improved PHPDoc
This commit is contained in:
parent
561cde7743
commit
17284937f6
@ -641,7 +641,7 @@ class Request
|
||||
* 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
|
||||
*/
|
||||
@ -923,7 +923,7 @@ class Request
|
||||
*
|
||||
* @param array $locales An array of ordered available locales
|
||||
*
|
||||
* @return string The preferred locale
|
||||
* @return string|null The preferred locale
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
@ -1037,6 +1037,8 @@ class Request
|
||||
* 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)
|
||||
{
|
||||
|
@ -718,8 +718,8 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
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')));
|
||||
@ -795,10 +795,10 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
$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));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user