mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fix more coding style errors.
This commit is contained in:
parent
480c1bbb54
commit
e33dc98124
3 changed files with 7 additions and 84 deletions
|
@ -2668,7 +2668,7 @@ class I18nTest extends CakeTestCase {
|
||||||
private function __domainCategoryPlural($domain = 'test_plugin', $category = 3) {
|
private function __domainCategoryPlural($domain = 'test_plugin', $category = 3) {
|
||||||
$plurals = array();
|
$plurals = array();
|
||||||
for ($number = 0; $number <= 25; $number++) {
|
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;
|
return $plurals;
|
||||||
}
|
}
|
||||||
|
@ -2691,7 +2691,7 @@ class I18nTest extends CakeTestCase {
|
||||||
private function __domainPlural($domain = 'test_plugin') {
|
private function __domainPlural($domain = 'test_plugin') {
|
||||||
$plurals = array();
|
$plurals = array();
|
||||||
for ($number = 0; $number <= 25; $number++) {
|
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;
|
return $plurals;
|
||||||
}
|
}
|
||||||
|
@ -2724,7 +2724,7 @@ class I18nTest extends CakeTestCase {
|
||||||
private function __plural() {
|
private function __plural() {
|
||||||
$plurals = array();
|
$plurals = array();
|
||||||
for ($number = 0; $number <= 25; $number++) {
|
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;
|
return $plurals;
|
||||||
}
|
}
|
||||||
|
@ -2747,7 +2747,7 @@ class I18nTest extends CakeTestCase {
|
||||||
private function __pluralFromCore() {
|
private function __pluralFromCore() {
|
||||||
$plurals = array();
|
$plurals = array();
|
||||||
for ($number = 0; $number <= 25; $number++) {
|
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;
|
return $plurals;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,6 @@ class L10nTest extends CakeTestCase {
|
||||||
$l10n->get('');
|
$l10n->get('');
|
||||||
$this->assertEquals($l10n->lang, 'en-us');
|
$this->assertEquals($l10n->lang, 'en-us');
|
||||||
|
|
||||||
|
|
||||||
// Using $this->default
|
// Using $this->default
|
||||||
$l10n = new L10n();
|
$l10n = new L10n();
|
||||||
|
|
||||||
|
@ -83,7 +82,7 @@ class L10nTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testGetAutoLanguage() {
|
public function testGetAutoLanguage() {
|
||||||
$__SERVER = $_SERVER;
|
$serverBackup = $_SERVER;
|
||||||
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'inexistent,en-ca';
|
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'inexistent,en-ca';
|
||||||
|
|
||||||
$l10n = new L10n();
|
$l10n = new L10n();
|
||||||
|
@ -107,7 +106,7 @@ class L10nTest extends CakeTestCase {
|
||||||
$this->assertEquals($l10n->languagePath, array('eng', 'eng', 'eng'));
|
$this->assertEquals($l10n->languagePath, array('eng', 'eng', 'eng'));
|
||||||
$this->assertEquals($l10n->locale, 'eng');
|
$this->assertEquals($l10n->locale, 'eng');
|
||||||
|
|
||||||
$_SERVER = $__SERVER;
|
$_SERVER = $serverBackup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -895,7 +894,7 @@ class L10nTest extends CakeTestCase {
|
||||||
$result = $l10n->catalog(array('cy'));
|
$result = $l10n->catalog(array('cy'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'cy' => array('language' => 'Welsh', 'locale' => 'cym', 'localeFallback' => 'cym', 'charset' => 'utf-8',
|
'cy' => array('language' => 'Welsh', 'locale' => 'cym', 'localeFallback' => 'cym', 'charset' => 'utf-8',
|
||||||
'direction' => 'ltr')
|
'direction' => 'ltr')
|
||||||
);
|
);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
|
|
@ -159,14 +159,12 @@ class MultibyteTest extends CakeTestCase {
|
||||||
65265, 65266, 65267, 65268, 65269, 65270, 65271, 65272, 65273, 65274, 65275, 65276);
|
65265, 65266, 65267, 65268, 65269, 65270, 65271, 65272, 65273, 65274, 65275, 65276);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
|
||||||
$string = 'abcdefghijklmnopqrstuvwxyz';
|
$string = 'abcdefghijklmnopqrstuvwxyz';
|
||||||
$result = Multibyte::utf8($string);
|
$result = Multibyte::utf8($string);
|
||||||
$expected = array(65345, 65346, 65347, 65348, 65349, 65350, 65351, 65352, 65353, 65354, 65355, 65356, 65357, 65358, 65359, 65360,
|
$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);
|
65361, 65362, 65363, 65364, 65365, 65366, 65367, 65368, 65369, 65370);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
|
||||||
$string = '。「」、・ヲァィゥェォャュョッーアイウエオカキク';
|
$string = '。「」、・ヲァィゥェォャュョッーアイウエオカキク';
|
||||||
$result = Multibyte::utf8($string);
|
$result = Multibyte::utf8($string);
|
||||||
$expected = array(65377, 65378, 65379, 65380, 65381, 65382, 65383, 65384, 65385, 65386, 65387, 65388, 65389, 65390, 65391, 65392,
|
$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);
|
11489, 11491);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
|
||||||
$string = 'fffiflffifflſtstﬓﬔﬕﬖﬗ';
|
$string = 'fffiflffifflſtstﬓﬔﬕﬖﬗ';
|
||||||
$result = Multibyte::utf8($string);
|
$result = Multibyte::utf8($string);
|
||||||
$expected = array(64256, 64257, 64258, 64259, 64260, 64261, 64262, 64275, 64276, 64277, 64278, 64279);
|
$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);
|
$result = mb_strtolower($string);
|
||||||
$expected = 'ἀι';
|
$expected = 'ἀι';
|
||||||
$this->assertEquals($expected, $result);
|
$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ﬓﬔﬕﬖﬗ';
|
$string = 'fffiflffifflſtstﬓﬔﬕﬖﬗ';
|
||||||
$result = mb_strtolower($string);
|
$result = mb_strtolower($string);
|
||||||
$expected = 'fffiflffifflſtstﬓﬔﬕﬖﬗ';
|
$expected = 'fffiflffifflſtstﬓﬔﬕﬖﬗ';
|
||||||
|
@ -7696,29 +7643,6 @@ mb_strtolower does not work for these strings.
|
||||||
$expected = 'ΩKÅ';
|
$expected = 'ΩKÅ';
|
||||||
$this->assertEquals($expected, $result);
|
$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ﬓﬔﬕﬖﬗ';
|
$string = 'fffiflffifflſtstﬓﬔﬕﬖﬗ';
|
||||||
$result = mb_strtoupper($string);
|
$result = mb_strtoupper($string);
|
||||||
$expected = 'fffiflffifflſtstﬓﬔﬕﬖﬗ';
|
$expected = 'fffiflffifflſtstﬓﬔﬕﬖﬗ';
|
||||||
|
|
Loading…
Add table
Reference in a new issue