diff --git a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php index 6e15893..5d91526 100644 --- a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php @@ -33,7 +33,7 @@ class HtmlTest extends UnitTestCase { public function testLoad($html, $tags) { $doc = Html::load($html); // If we have a document we did our job. - $this->assertTrue(is_a($doc, '\DOMDocument')); + $this->assertInstanceOf('\DomDocument', $doc); foreach ($tags as $tag_name => $length) { $tag = $doc->getElementsByTagName($tag_name); diff --git a/core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php b/core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php index 3256587..b14c347 100644 --- a/core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php @@ -2,7 +2,7 @@ /** * @file - * Container Drupal\Tests\Component\Utility\UserAgentTest + * Container Drupal\Tests\Component\Utility\UserAgentTest. */ namespace Drupal\Tests\Component\Utility; @@ -76,9 +76,16 @@ protected function getMappings() { */ public function testGetBestMatchingLangcode($accept_language, $expected) { $result = UserAgent::getBestMatchingLangcode($accept_language, $this->getLanguages(), $this->getMappings()); - $this->assertSame($expected, $result, $accept_language); + $this->assertSame($expected, $result); } + /** + * Data provider for testGetBestMatchingLangcode(). + * + * @return array + * - An accept-language string. + * - Expected best matching language code. + */ public function providerTestGetBestMatchingLangcode() { return array( // Equal qvalue for each language, choose the site preferred one. @@ -146,9 +153,9 @@ public function providerTestGetBestMatchingLangcode() { array('zh-tw, en-us;q=0.90, en;q=0.80, zh;q=0.70', 'zh-hant'), array('zh-hant, en-us;q=0.90, en;q=0.80, zh;q=0.70', 'zh-hant'), array('zh-hans, en-us;q=0.90, en;q=0.80, zh;q=0.70', 'zh-hans'), - // TODO This is copied from RFC4647 but our regex skips the numbers so they - // where removed. Our code should be updated so private1-private2 is valid. - // http://tools.ietf.org/html/rfc4647#section-3.4 + // @todo: This is copied from RFC4647 but our regex skips the numbers so + // they where removed. Our code should be updated so private1-private2 is + // valid. http://tools.ietf.org/html/rfc4647#section-3.4 array('zh-hant-CN-x-private-private, en-us;q=0.90, en;q=0.80, zh;q=0.70', 'zh-hant'), array('zh-cn', 'zh-hans'), array('zh-sg', 'zh-hans'), @@ -160,6 +167,6 @@ public function providerTestGetBestMatchingLangcode() { array('zh-chs', 'zh-hans'), array('zh-cht', 'zh-hant'), ); - } + }