From e33dc98124591d158bd7f6965d08b13b278785ff Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 18 Mar 2012 18:52:35 -0400 Subject: [PATCH] Fix more coding style errors. --- lib/Cake/Test/Case/I18n/I18nTest.php | 8 +-- lib/Cake/Test/Case/I18n/L10nTest.php | 7 +-- lib/Cake/Test/Case/I18n/MultibyteTest.php | 76 ----------------------- 3 files changed, 7 insertions(+), 84 deletions(-) diff --git a/lib/Cake/Test/Case/I18n/I18nTest.php b/lib/Cake/Test/Case/I18n/I18nTest.php index 9218e0ff4..8cc480aa3 100644 --- a/lib/Cake/Test/Case/I18n/I18nTest.php +++ b/lib/Cake/Test/Case/I18n/I18nTest.php @@ -2668,7 +2668,7 @@ class I18nTest extends CakeTestCase { private function __domainCategoryPlural($domain = 'test_plugin', $category = 3) { $plurals = array(); for ($number = 0; $number <= 25; $number++) { - $plurals[] = sprintf(__dcn($domain, '%d = 1', '%d = 0 or > 1', (float)$number, $category), (float)$number); + $plurals[] = sprintf(__dcn($domain, '%d = 1', '%d = 0 or > 1', (float)$number, $category), (float)$number); } return $plurals; } @@ -2691,7 +2691,7 @@ class I18nTest extends CakeTestCase { private function __domainPlural($domain = 'test_plugin') { $plurals = array(); for ($number = 0; $number <= 25; $number++) { - $plurals[] = sprintf(__dn($domain, '%d = 1', '%d = 0 or > 1', (float)$number), (float)$number ); + $plurals[] = sprintf(__dn($domain, '%d = 1', '%d = 0 or > 1', (float)$number), (float)$number ); } return $plurals; } @@ -2724,7 +2724,7 @@ class I18nTest extends CakeTestCase { private function __plural() { $plurals = array(); for ($number = 0; $number <= 25; $number++) { - $plurals[] = sprintf(__n('%d = 1', '%d = 0 or > 1', (float)$number), (float)$number); + $plurals[] = sprintf(__n('%d = 1', '%d = 0 or > 1', (float)$number), (float)$number); } return $plurals; } @@ -2747,7 +2747,7 @@ class I18nTest extends CakeTestCase { private function __pluralFromCore() { $plurals = array(); for ($number = 0; $number <= 25; $number++) { - $plurals[] = sprintf(__n('%d = 1 (from core)', '%d = 0 or > 1 (from core)', (float)$number), (float)$number ); + $plurals[] = sprintf(__n('%d = 1 (from core)', '%d = 0 or > 1 (from core)', (float)$number), (float)$number ); } return $plurals; } diff --git a/lib/Cake/Test/Case/I18n/L10nTest.php b/lib/Cake/Test/Case/I18n/L10nTest.php index 7fb9b98c2..aac961a47 100644 --- a/lib/Cake/Test/Case/I18n/L10nTest.php +++ b/lib/Cake/Test/Case/I18n/L10nTest.php @@ -67,7 +67,6 @@ class L10nTest extends CakeTestCase { $l10n->get(''); $this->assertEquals($l10n->lang, 'en-us'); - // Using $this->default $l10n = new L10n(); @@ -83,7 +82,7 @@ class L10nTest extends CakeTestCase { * @return void */ public function testGetAutoLanguage() { - $__SERVER = $_SERVER; + $serverBackup = $_SERVER; $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'inexistent,en-ca'; $l10n = new L10n(); @@ -107,7 +106,7 @@ class L10nTest extends CakeTestCase { $this->assertEquals($l10n->languagePath, array('eng', 'eng', 'eng')); $this->assertEquals($l10n->locale, 'eng'); - $_SERVER = $__SERVER; + $_SERVER = $serverBackup; } /** @@ -895,7 +894,7 @@ class L10nTest extends CakeTestCase { $result = $l10n->catalog(array('cy')); $expected = array( 'cy' => array('language' => 'Welsh', 'locale' => 'cym', 'localeFallback' => 'cym', 'charset' => 'utf-8', -'direction' => 'ltr') + 'direction' => 'ltr') ); $this->assertEquals($expected, $result); diff --git a/lib/Cake/Test/Case/I18n/MultibyteTest.php b/lib/Cake/Test/Case/I18n/MultibyteTest.php index e6033b7c0..47445874f 100644 --- a/lib/Cake/Test/Case/I18n/MultibyteTest.php +++ b/lib/Cake/Test/Case/I18n/MultibyteTest.php @@ -159,14 +159,12 @@ class MultibyteTest extends CakeTestCase { 65265, 65266, 65267, 65268, 65269, 65270, 65271, 65272, 65273, 65274, 65275, 65276); $this->assertEquals($expected, $result); - $string = 'abcdefghijklmnopqrstuvwxyz'; $result = Multibyte::utf8($string); $expected = array(65345, 65346, 65347, 65348, 65349, 65350, 65351, 65352, 65353, 65354, 65355, 65356, 65357, 65358, 65359, 65360, 65361, 65362, 65363, 65364, 65365, 65366, 65367, 65368, 65369, 65370); $this->assertEquals($expected, $result); - $string = '。「」、・ヲァィゥェォャュョッーアイウエオカキク'; $result = Multibyte::utf8($string); $expected = array(65377, 65378, 65379, 65380, 65381, 65382, 65383, 65384, 65385, 65386, 65387, 65388, 65389, 65390, 65391, 65392, @@ -341,7 +339,6 @@ class MultibyteTest extends CakeTestCase { 11489, 11491); $this->assertEquals($expected, $result); - $string = 'fffiflffifflſtstﬓﬔﬕﬖﬗ'; $result = Multibyte::utf8($string); $expected = array(64256, 64257, 64258, 64259, 64260, 64261, 64262, 64275, 64276, 64277, 64278, 64279); @@ -6566,57 +6563,7 @@ class MultibyteTest extends CakeTestCase { $result = mb_strtolower($string); $expected = 'ἀι'; $this->assertEquals($expected, $result); -/* - The tests below are flaky across different platforms. - $string = 'ԀԂԄԆԈԊԌԎԐԒ'; - $result = mb_strtolower($string); - $expected = 'ԁԃԅԇԉԋԍԏԑԓ'; - $this->assertEquals($expected, $result); - - $string = 'ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖև'; - $result = mb_strtolower($string); - $expected = 'աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆև'; - $this->assertEquals($expected, $result); - - $string = 'ḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẖẗẘẙẚẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸ'; - $result = mb_strtolower($string); - $expected = 'ḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕẖẗẘẙẚạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹ'; - $this->assertEquals($expected, $result); - - $string = 'ΩKÅ'; - $result = mb_strtolower($string); - $expected = 'ωkå'; - $this->assertEquals($expected, $result); - - $string = 'ΩKÅ'; - $result = mb_strtolower($string); - $expected = 'ωkå'; - $this->assertEquals($expected, $result); - -/* -mb_strtolower does not work for these strings. - - $string = 'ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯↃ'; - $result = mb_strtolower($string); - $expected = 'ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿↄ'; - $this->assertEquals($expected, $result); - - $string = 'ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ'; - $result = mb_strtolower($string); - $expected = 'ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ'; - $this->assertEquals($expected, $result); - - $string = 'ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰢⰣⰤⰥⰦⰧⰨⰩⰪⰫⰬⰭⰮ'; - $result = mb_strtolower($string); - $expected = 'ⰰⰱⰲⰳⰴⰵⰶⰷⰸⰹⰺⰻⰼⰽⰾⰿⱀⱁⱂⱃⱄⱅⱆⱇⱈⱉⱊⱋⱌⱍⱎⱏⱐⱑⱒⱓⱔⱕⱖⱗⱘⱙⱚⱛⱜⱝⱞ'; - $this->assertEquals($expected, $result); - - $string = 'ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢ'; - $result = mb_strtolower($string); - $expected = 'ⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣ'; - $this->assertEquals($expected, $result); -*/ $string = 'fffiflffifflſtstﬓﬔﬕﬖﬗ'; $result = mb_strtolower($string); $expected = 'fffiflffifflſtstﬓﬔﬕﬖﬗ'; @@ -7696,29 +7643,6 @@ mb_strtolower does not work for these strings. $expected = 'ΩKÅ'; $this->assertEquals($expected, $result); -/* -mb_strtoupper does not work for these strings. - - $string = 'ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿↄ'; - $result = mb_strtoupper($string); - $expected = 'ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯↃ'; - $this->assertEquals($expected, $result); - - $string = 'ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ'; - $result = mb_strtoupper($string); - $expected = 'ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ'; - $this->assertEquals($expected, $result); - - $string = 'ⰰⰱⰲⰳⰴⰵⰶⰷⰸⰹⰺⰻⰼⰽⰾⰿⱀⱁⱂⱃⱄⱅⱆⱇⱈⱉⱊⱋⱌⱍⱎⱏⱐⱑⱒⱓⱔⱕⱖⱗⱘⱙⱚⱛⱜⱝⱞ'; - $result = mb_strtoupper($string); - $expected = 'ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰢⰣⰤⰥⰦⰧⰨⰩⰪⰫⰬⰭⰮ'; - $this->assertEquals($expected, $result); - - $string = 'ⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣ'; - $result = mb_strtoupper($string); - $expected = 'ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢ'; - $this->assertEquals($expected, $result); -*/ $string = 'fffiflffifflſtstﬓﬔﬕﬖﬗ'; $result = mb_strtoupper($string); $expected = 'fffiflffifflſtstﬓﬔﬕﬖﬗ';