PSR12
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/** DomFramework - Tests
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
@@ -14,47 +15,55 @@ class HttpTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/** bestChoice : exact existing entry
|
||||
*/
|
||||
public function testBestChoice1 ()
|
||||
{
|
||||
$http = new Http ();
|
||||
$res = $http->bestChoice (
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||
array ("application/xml"), "text/html");
|
||||
$this->assertSame ($res, "application/xml");
|
||||
}
|
||||
public function testBestChoice1()
|
||||
{
|
||||
$http = new Http();
|
||||
$res = $http->bestChoice(
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||
array ("application/xml"),
|
||||
"text/html"
|
||||
);
|
||||
$this->assertSame($res, "application/xml");
|
||||
}
|
||||
|
||||
/** bestChoice : Generic catch.
|
||||
* Use default value
|
||||
*/
|
||||
public function testBestChoice2 ()
|
||||
{
|
||||
$http = new Http ();
|
||||
$res = $http->bestChoice (
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||
array ("text/plain"), "text/html");
|
||||
$this->assertSame ($res, "text/html");
|
||||
}
|
||||
public function testBestChoice2()
|
||||
{
|
||||
$http = new Http();
|
||||
$res = $http->bestChoice(
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||
array ("text/plain"),
|
||||
"text/html"
|
||||
);
|
||||
$this->assertSame($res, "text/html");
|
||||
}
|
||||
|
||||
/** bestChoice : no solution : use the default value
|
||||
*/
|
||||
public function testBestChoice3 ()
|
||||
{
|
||||
$http = new Http ();
|
||||
$res = $http->bestChoice (
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9",
|
||||
array ("text/plain"), "text/html");
|
||||
$this->assertSame ($res, "text/html");
|
||||
}
|
||||
public function testBestChoice3()
|
||||
{
|
||||
$http = new Http();
|
||||
$res = $http->bestChoice(
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9",
|
||||
array ("text/plain"),
|
||||
"text/html"
|
||||
);
|
||||
$this->assertSame($res, "text/html");
|
||||
}
|
||||
|
||||
/** bestChoice : invalid entry (end with comma). Continue without error and
|
||||
* skip the bad choices
|
||||
*/
|
||||
public function testBestChoice4 ()
|
||||
{
|
||||
$http = new Http ();
|
||||
$res = $http->bestChoice (
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,",
|
||||
array ("text/plain"), "text/html");
|
||||
$this->assertSame ($res, "text/html");
|
||||
}
|
||||
public function testBestChoice4()
|
||||
{
|
||||
$http = new Http();
|
||||
$res = $http->bestChoice(
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,",
|
||||
array ("text/plain"),
|
||||
"text/html"
|
||||
);
|
||||
$this->assertSame($res, "text/html");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user