From 48b3a6a236d229a203f5c20c705c901ee43ca4c2 Mon Sep 17 00:00:00 2001 From: knut <> Date: Mon, 30 Jan 2006 21:30:35 +0000 Subject: - Ported a few unit tests from the I18N package - Moving report stylesheets to buildscripts/phing - Added a build/dist target for both standard distribution and PEAR package to build.xml --- .gitattributes | 14 +- build.xml | 162 +++++- buildscripts/phing/style/coverage-frames.xsl | 636 ++++++++++++++++++++ buildscripts/phing/style/log.xsl | 216 +++++++ buildscripts/phing/style/phpunit2-frames.xsl | 677 ++++++++++++++++++++++ buildscripts/phing/style/phpunit2-noframes.xsl | 436 ++++++++++++++ buildscripts/phing/style/str.replace.function.xsl | 105 ++++ etc/style/coverage-frames.xsl | 636 -------------------- etc/style/log.xsl | 216 ------- etc/style/phpunit2-frames.xsl | 677 ---------------------- etc/style/phpunit2-noframes.xsl | 436 -------------- etc/style/str.replace.function.xsl | 105 ---- tests/unit/I18N/TNumberFormatTest.php | 103 ---- tests/unit/I18N/core/CultureInfoTest.php | 81 +++ tests/unit/I18N/core/NumberFormatInfoTest.php | 88 +++ tests/unit/I18N/core/NumberFormatTest.php | 111 ++++ 16 files changed, 2502 insertions(+), 2197 deletions(-) create mode 100644 buildscripts/phing/style/coverage-frames.xsl create mode 100644 buildscripts/phing/style/log.xsl create mode 100644 buildscripts/phing/style/phpunit2-frames.xsl create mode 100644 buildscripts/phing/style/phpunit2-noframes.xsl create mode 100644 buildscripts/phing/style/str.replace.function.xsl delete mode 100644 etc/style/coverage-frames.xsl delete mode 100644 etc/style/log.xsl delete mode 100644 etc/style/phpunit2-frames.xsl delete mode 100644 etc/style/phpunit2-noframes.xsl delete mode 100644 etc/style/str.replace.function.xsl delete mode 100644 tests/unit/I18N/TNumberFormatTest.php create mode 100644 tests/unit/I18N/core/CultureInfoTest.php create mode 100644 tests/unit/I18N/core/NumberFormatInfoTest.php create mode 100644 tests/unit/I18N/core/NumberFormatTest.php diff --git a/.gitattributes b/.gitattributes index 8af5493f..426151cd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,6 +7,11 @@ buildscripts/.htaccess -text buildscripts/jsbuilder/build.php -text buildscripts/jsbuilder/custom_rhino.jar -text buildscripts/jsbuilder/packer.js -text +buildscripts/phing/style/coverage-frames.xsl -text +buildscripts/phing/style/log.xsl -text +buildscripts/phing/style/phpunit2-frames.xsl -text +buildscripts/phing/style/phpunit2-noframes.xsl -text +buildscripts/phing/style/str.replace.function.xsl -text buildscripts/phpbuilder/build.php -text buildscripts/phpbuilder/files.txt -text buildscripts/texbuilder/build.php -text @@ -201,11 +206,6 @@ demos/quickstart/themes/Simple/style.css -text docs/application.xml -text docs/conceptual-structure.vsd -text docs/request-sequence.vsd -text -etc/style/coverage-frames.xsl -text -etc/style/log.xsl -text -etc/style/phpunit2-frames.xsl -text -etc/style/phpunit2-noframes.xsl -text -etc/style/str.replace.function.xsl -text framework/.htaccess -text framework/3rdParty/SafeHtml/HTMLSax3.php -text framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php -text @@ -964,6 +964,8 @@ tests/UnitTests/simpletest/web_tester.php -text tests/UnitTests/simpletest/xml.php -text tests/unit/Collections/TListTest.php -text tests/unit/Collections/TMapTest.php -text -tests/unit/I18N/TNumberFormatTest.php -text +tests/unit/I18N/core/CultureInfoTest.php -text +tests/unit/I18N/core/NumberFormatInfoTest.php -text +tests/unit/I18N/core/NumberFormatTest.php -text tests/unit/TComponentTest.php -text tests/unit/phpunit2.php -text diff --git a/build.xml b/build.xml index 0f239e71..ae7deecf 100644 --- a/build.xml +++ b/build.xml @@ -7,26 +7,54 @@ Phing > 2.1.1 (currently cvs HEAD needed) xdebug >= 2.0.0beta4 PhpDocumentor >= 1.3.0RC5 - + PEAR >= 1.4.4 + PEAR_PackageFileManager >= 1.6.0a4 --> - + + + - + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + - - - + + + @@ -40,10 +68,26 @@ - - Generating API documentation - - + + + + + + + + + PRADO version for package + + + + + + + + + + + @@ -92,17 +136,99 @@ - - TBD + + Cleaning up after last build + + Creating directory layout... + + + + + + + + + + + + + + + Creating directory layout... + + + + + + + + Creating PEAR package.xml... + + + + + + + + + + + + Validating package.xml + + + + + Creating tar.gz package... + + + Cleaning up the mess - - - - + + + + \ No newline at end of file diff --git a/buildscripts/phing/style/coverage-frames.xsl b/buildscripts/phing/style/coverage-frames.xsl new file mode 100644 index 00000000..edfcf298 --- /dev/null +++ b/buildscripts/phing/style/coverage-frames.xsl @@ -0,0 +1,636 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Coverage Results. + + + + + + + + + <h2>Frame Alert</h2> + <p> + This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. + </p> + + + + + + + + .bannercell { + border: 0px; + padding: 0px; + } + body { + margin-left: 10; + margin-right: 10; + background-color:#FFFFFF; + font-family: verdana,arial,sanserif; + color:#000000; + } + a { + color: #003399; + } + a:hover { + color: #888888; + } + .a td { + background: #efefef; + } + .b td { + background: #fff; + } + th, td { + text-align: left; + vertical-align: top; + } + th { + font-weight:bold; + background: #ccc; + color: black; + } + table, th, td { + font-size: 12px; + border: none + } + table.log tr td, tr th { + } + h2 { + font-weight:bold; + font-size: 12px; + margin-bottom: 5; + } + h3 { + font-size:100%; + font-weight: 12px; + background: #DFDFDF + color: white; + text-decoration: none; + padding: 5px; + margin-right: 2px; + margin-left: 2px; + margin-bottom: 0; + } + .small { + font-size: 9px; + } +TD.empty { + FONT-SIZE: 2px; BACKGROUND: #c0c0c0; BORDER:#9c9c9c 1px solid; + color: #c0c0c0; +} +TD.fullcover { + FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER:#9c9c9c 1px solid; + color: #00df00; +} +TD.covered { + FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER-LEFT:#9c9c9c 1px solid;BORDER-TOP:#9c9c9c 1px solid;BORDER-BOTTOM:#9c9c9c 1px solid; + color: #00df00; +} +TD.uncovered { + FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER:#9c9c9c 1px solid; + color: #df0000; +} +PRE.srcLine { + BACKGROUND: #ffffff; MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; +} +td.lineCount, td.coverageCount { + BACKGROUND: #F0F0F0; PADDING-RIGHT: 3px; + text-align: right; +} +td.lineCountHighlight { + background: #C8C8F0; PADDING-RIGHT: 3px; + text-align: right; +} +td.coverageCountHighlight { + background: #F0C8C8; PADDING-RIGHT: 3px; + text-align: right; +} +span.srcLineHighlight { + background: #F0C8C8; +} +span.srcLine { + background: #C8C8F0; +} +TD.srcLineClassStart { + WIDTH: 100%; BORDER-TOP:#dcdcdc 1px solid; FONT-WEIGHT: bold; +} +.srcLine , .srcLine ol, .srcLine ol li {margin: 0;} +.srcLine .de1, .srcLine .de2 {font-family: 'Courier New', Courier, monospace; font-weight: normal;} +.srcLine .imp {font-weight: bold; color: red;} +.srcLine .kw1 {color: #b1b100;} +.srcLine .kw2 {color: #000000; font-weight: bold;} +.srcLine .kw3 {color: #000066;} +.srcLine .co1 {color: #808080; font-style: italic;} +.srcLine .co2 {color: #808080; font-style: italic;} +.srcLine .coMULTI {color: #808080; font-style: italic;} +.srcLine .es0 {color: #000099; font-weight: bold;} +.srcLine .br0 {color: #66cc66;} +.srcLine .st0 {color: #ff0000;} +.srcLine .nu0 {color: #cc66cc;} +.srcLine .me1 {color: #006600;} +.srcLine .me2 {color: #006600;} +.srcLine .re0 {color: #0000ff;} + + + + + + + + + +

All Classes

+ + + + + + + / + .html + + + + + +
+ + + + (-) + + + () + + +
+ + +
+ + + + + + + + +

Overview

+

All Packages

+ + + + + + + +
+ + + +
+ + +
+ + + + + + + + + + + + + + + + +
Packages: Classes: Methods: LOC:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods covered
Total coverage

PackagesMethods covered
+ + + +
+ + + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+
+ +

Classes

+ + + + + + + +
+ + + + (-) + + + () + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
Classes: Methods: LOC:
+
+ + + + + + + + + + + + + + + + + + + + +
PackageMethods covered

ClassesMethods covered
+ + + +
+ + + + + + + + + + + + + + + + + +
Methods: LOC:
+
+ + + + + + + + + + + + +
Source fileMethods covered
+ + +
+
+ + + + +
+ + + + + + + + + + + + +
+ + http://phing.info/ + +

Source Code Coverage

Designed for use with PHPUnit2, Xdebug and Phing.
+
+
+ + + + + + +

Report generated at
+
+ + + + + + + + + + + + + + + + + + + + + - + + + + + +
 
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
   
+ +
+
+
+ + + + + + + + + + 0 + + + + + + + + srcLineClassStart + + + +
+
+
+ + +
+
+
+ +
+
+ + +
+ + + + + + ../ + + + + + + ../ + + + + + + + + stylesheet.css + + + + + + a + b + + + +
+ + diff --git a/buildscripts/phing/style/log.xsl b/buildscripts/phing/style/log.xsl new file mode 100644 index 00000000..a460b667 --- /dev/null +++ b/buildscripts/phing/style/log.xsl @@ -0,0 +1,216 @@ + + + + + + + + + + + Phing Build Log + + + + + + + + + +
+ + http://phing.info/ + + + Phing +
+ + + +

+ + + + + + + +

+
+ Phing +
+
+ + +
+ + + + + + failed + complete + + + + + + + + + + + + + +
Build FailedBuild CompleteTotal Time:
+ +
+ See the stacktrace. +
+
+ + + +
phing.file
phing.version
+ +

Build events

+ + + + + + + +
targettaskmessage
+

+ + + +

Error details

+ + +
+
+
+ +

+
+ + + + + + + a + b + + + [ ] + + + + + + +
diff --git a/buildscripts/phing/style/phpunit2-frames.xsl b/buildscripts/phing/style/phpunit2-frames.xsl new file mode 100644 index 00000000..7ccc4f33 --- /dev/null +++ b/buildscripts/phing/style/phpunit2-frames.xsl @@ -0,0 +1,677 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unit Test Results. + + + + + + + + + <h2>Frame Alert</h2> + <p> + This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. + </p> + + + + + + + +body { + font-family: verdana,arial,helvetica; + color:#000000; + font-size: 12px; +} +table tr td, table tr th { + font-family: verdana,arial,helvetica; + font-size: 12px; +} +table.details tr th{ + font-family: verdana,arial,helvetica; + font-weight: bold; + text-align:left; + background:#a6caf0; +} +table.details tr td{ + background:#eeeee0; +} + +p { + line-height:1.5em; + margin-top:0.5em; margin-bottom:1.0em; + font-size: 12px; +} +h1 { + margin: 0px 0px 5px; + font-family: verdana,arial,helvetica; +} +h2 { + margin-top: 1em; margin-bottom: 0.5em; + font-family: verdana,arial,helvetica; +} +h3 { + margin-bottom: 0.5em; + font-family: verdana,arial,helvetica; +} +h4 { + margin-bottom: 0.5em; + font-family: verdana,arial,helvetica; +} +h5 { + margin-bottom: 0.5em; + font-family: verdana,arial,helvetica; +} +h6 { + margin-bottom: 0.5em; + font-family: verdana,arial,helvetica; +} +.Error { + font-weight:bold; color:red; +} +.Failure { + font-weight:bold; color:purple; +} +.small { + font-size: 9px; +} +a { + color: #003399; +} +a:hover { + color: #888888; +} + + + + + + + . + + + Unit Test Results: <xsl:value-of select="$class.name"/> + + + + + + +

Class

+ + + + + +
+ +

Tests

+ + + + + + + + + +
+ + + +
+ + + + + + + + Unit Test Classes: <xsl:value-of select="$name"/> + + + + + + + + + +
+

+ + <none> +

+
+ +

Classes

+ + + + + + + +
+ +
+ + +
+ + + + + + + All Unit Test Classes + + + + + +

Classes

+ + + + +
+ + +
+ + + + + +
+ + + / + .html + + + + + + + + + + + + + All Unit Test Packages + + + + + +

Home

+

Packages

+ + + + +
+ + +
+ + + + + + + <none> + + + + + + + + + + Unit Test Results: Summary + + + + + + open('allclasses-frame.html','classListFrame') + +

Summary

+ + + + + + + + + + + + + + + + + Error + Failure + Pass + + + + + + + + + +
TestsFailuresErrorsSuccess rateTime
+ + + + + + + +
+ + + + +
+ Note: failures are anticipated and checked for with assertions while errors are unanticipated. +
+ +

Packages

+ + + + + + + + + + + Error + Failure + Pass + + + + + + + + + +
+ + <none> + + + + +
+ + + +
+ + + + + + + + + + + + open('package-frame.html','classListFrame') + +

Package

+ + + + + +

Classes

+

+ + + + + +
+

+
+ + + +
+ + + + + + + ../ + + + + + + ../ + + + + + + + + stylesheet.css + + + + + +

Unit Test Results

+ + + + + +
Designed for use with PHPUnit2 and Phing.
+
+
+ + + + + + +

Report generated at
+
+ + + + + Name + Tests + Errors + Failures + Time(s) + + + + + + + Name + Status + Type + Time(s) + + + + + + + + + + Error + Failure + Pass + + + + + + + + + + + + + + + + + + Error + Failure + TableRowColor + + + + + + Failure + + + + Error + + + + Success + + + + + + + + + + + + + + + + + + + + + + + + + N/A + + + + + +

+ + + + + +
+ + + + + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + + diff --git a/buildscripts/phing/style/phpunit2-noframes.xsl b/buildscripts/phing/style/phpunit2-noframes.xsl new file mode 100644 index 00000000..d2c772da --- /dev/null +++ b/buildscripts/phing/style/phpunit2-noframes.xsl @@ -0,0 +1,436 @@ + + + + + + + + + + + Unit Test Results + + + + + + + + +
+ + + +
+ + + +
+ + + + + + + +
+ + + + + + + + +

Packages

+ Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers. + + + + + + + + + + + + + + + + + Failure + Error + + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + +

Package

+ + + + + + +
+ Back to top +

+

+ + + + + + + + +

TestCase

+ + + + + + + + + + +
+

+ + Back to top + + + + +

Summary

+ + + + + + + + + + + + + + + + + Failure + Error + + + + + + + + + +
TestsFailuresErrorsSuccess rateTime
+ + + + + + + +
+ + + + +
+ Note: failures are anticipated and checked for with assertions while errors are unanticipated. +
+
+ + + +

Unit Test Results

+ + + + + +
Designed for use with PHPUnit2 and Phing.
+
+
+ + + + + + +

Report generated at
+
+ + + + Name + Tests + Errors + Failures + Time(s) + + + + + + + Name + Tests + Errors + Failures + Time(s) + + + + + + + Name + Status + Type + Time(s) + + + + + + + + + + + Failure + Error + + + + + + + + + + + + + + + + + + + + + Error + + + + + + Failure + + + + Error + + + + Success + + + + + + + + + + + + + + + + + + + + + + + + N/A + + + + + + +

+ + + +
+
+ + + + + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + +
+ diff --git a/buildscripts/phing/style/str.replace.function.xsl b/buildscripts/phing/style/str.replace.function.xsl new file mode 100644 index 00000000..5d74e86c --- /dev/null +++ b/buildscripts/phing/style/str.replace.function.xsl @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ERROR: function implementation of str:replace() relies on exsl:node-set(). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/etc/style/coverage-frames.xsl b/etc/style/coverage-frames.xsl deleted file mode 100644 index edfcf298..00000000 --- a/etc/style/coverage-frames.xsl +++ /dev/null @@ -1,636 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Coverage Results. - - - - - - - - - <h2>Frame Alert</h2> - <p> - This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. - </p> - - - - - - - - .bannercell { - border: 0px; - padding: 0px; - } - body { - margin-left: 10; - margin-right: 10; - background-color:#FFFFFF; - font-family: verdana,arial,sanserif; - color:#000000; - } - a { - color: #003399; - } - a:hover { - color: #888888; - } - .a td { - background: #efefef; - } - .b td { - background: #fff; - } - th, td { - text-align: left; - vertical-align: top; - } - th { - font-weight:bold; - background: #ccc; - color: black; - } - table, th, td { - font-size: 12px; - border: none - } - table.log tr td, tr th { - } - h2 { - font-weight:bold; - font-size: 12px; - margin-bottom: 5; - } - h3 { - font-size:100%; - font-weight: 12px; - background: #DFDFDF - color: white; - text-decoration: none; - padding: 5px; - margin-right: 2px; - margin-left: 2px; - margin-bottom: 0; - } - .small { - font-size: 9px; - } -TD.empty { - FONT-SIZE: 2px; BACKGROUND: #c0c0c0; BORDER:#9c9c9c 1px solid; - color: #c0c0c0; -} -TD.fullcover { - FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER:#9c9c9c 1px solid; - color: #00df00; -} -TD.covered { - FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER-LEFT:#9c9c9c 1px solid;BORDER-TOP:#9c9c9c 1px solid;BORDER-BOTTOM:#9c9c9c 1px solid; - color: #00df00; -} -TD.uncovered { - FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER:#9c9c9c 1px solid; - color: #df0000; -} -PRE.srcLine { - BACKGROUND: #ffffff; MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; -} -td.lineCount, td.coverageCount { - BACKGROUND: #F0F0F0; PADDING-RIGHT: 3px; - text-align: right; -} -td.lineCountHighlight { - background: #C8C8F0; PADDING-RIGHT: 3px; - text-align: right; -} -td.coverageCountHighlight { - background: #F0C8C8; PADDING-RIGHT: 3px; - text-align: right; -} -span.srcLineHighlight { - background: #F0C8C8; -} -span.srcLine { - background: #C8C8F0; -} -TD.srcLineClassStart { - WIDTH: 100%; BORDER-TOP:#dcdcdc 1px solid; FONT-WEIGHT: bold; -} -.srcLine , .srcLine ol, .srcLine ol li {margin: 0;} -.srcLine .de1, .srcLine .de2 {font-family: 'Courier New', Courier, monospace; font-weight: normal;} -.srcLine .imp {font-weight: bold; color: red;} -.srcLine .kw1 {color: #b1b100;} -.srcLine .kw2 {color: #000000; font-weight: bold;} -.srcLine .kw3 {color: #000066;} -.srcLine .co1 {color: #808080; font-style: italic;} -.srcLine .co2 {color: #808080; font-style: italic;} -.srcLine .coMULTI {color: #808080; font-style: italic;} -.srcLine .es0 {color: #000099; font-weight: bold;} -.srcLine .br0 {color: #66cc66;} -.srcLine .st0 {color: #ff0000;} -.srcLine .nu0 {color: #cc66cc;} -.srcLine .me1 {color: #006600;} -.srcLine .me2 {color: #006600;} -.srcLine .re0 {color: #0000ff;} - - - - - - - - - -

All Classes

- - - - - - - / - .html - - - - - -
- - - - (-) - - - () - - -
- - -
- - - - - - - - -

Overview

-

All Packages

- - - - - - - -
- - - -
- - -
- - - - - - - - - - - - - - - - -
Packages: Classes: Methods: LOC:
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods covered
Total coverage

PackagesMethods covered
- - - -
- - - - - - . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

-
- -

Classes

- - - - - - - -
- - - - (-) - - - () - - -
- - -
- - - - - - - - - - - - - - - - - - -
Classes: Methods: LOC:
-
- - - - - - - - - - - - - - - - - - - - -
PackageMethods covered

ClassesMethods covered
- - - -
- - - - - - - - - - - - - - - - - -
Methods: LOC:
-
- - - - - - - - - - - - -
Source fileMethods covered
- - -
-
- - - - -
- - - - - - - - - - - - -
- - http://phing.info/ - -

Source Code Coverage

Designed for use with PHPUnit2, Xdebug and Phing.
-
-
- - - - - - -

Report generated at
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- -
- - - - - - - - - - - - - - - - - - - - - - - -
   
- -
-
-
- - - - - - - - - - 0 - - - - - - - - srcLineClassStart - - - -
-
-
- - -
-
-
- -
-
- - -
- - - - - - ../ - - - - - - ../ - - - - - - - - stylesheet.css - - - - - - a - b - - - -
- - diff --git a/etc/style/log.xsl b/etc/style/log.xsl deleted file mode 100644 index a460b667..00000000 --- a/etc/style/log.xsl +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - Phing Build Log - - - - - - - - - -
- - http://phing.info/ - - - Phing -
- - - -

- - - - - - - -

-
- Phing -
-
- - -
- - - - - - failed - complete - - - - - - - - - - - - - -
Build FailedBuild CompleteTotal Time:
- -
- See the stacktrace. -
-
- - - -
phing.file
phing.version
- -

Build events

- - - - - - - -
targettaskmessage
-

- - - -

Error details

- - -
-
-
- -

-
- - - - - - - a - b - - - [ ] - - - - - - -
diff --git a/etc/style/phpunit2-frames.xsl b/etc/style/phpunit2-frames.xsl deleted file mode 100644 index 7ccc4f33..00000000 --- a/etc/style/phpunit2-frames.xsl +++ /dev/null @@ -1,677 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Unit Test Results. - - - - - - - - - <h2>Frame Alert</h2> - <p> - This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. - </p> - - - - - - - -body { - font-family: verdana,arial,helvetica; - color:#000000; - font-size: 12px; -} -table tr td, table tr th { - font-family: verdana,arial,helvetica; - font-size: 12px; -} -table.details tr th{ - font-family: verdana,arial,helvetica; - font-weight: bold; - text-align:left; - background:#a6caf0; -} -table.details tr td{ - background:#eeeee0; -} - -p { - line-height:1.5em; - margin-top:0.5em; margin-bottom:1.0em; - font-size: 12px; -} -h1 { - margin: 0px 0px 5px; - font-family: verdana,arial,helvetica; -} -h2 { - margin-top: 1em; margin-bottom: 0.5em; - font-family: verdana,arial,helvetica; -} -h3 { - margin-bottom: 0.5em; - font-family: verdana,arial,helvetica; -} -h4 { - margin-bottom: 0.5em; - font-family: verdana,arial,helvetica; -} -h5 { - margin-bottom: 0.5em; - font-family: verdana,arial,helvetica; -} -h6 { - margin-bottom: 0.5em; - font-family: verdana,arial,helvetica; -} -.Error { - font-weight:bold; color:red; -} -.Failure { - font-weight:bold; color:purple; -} -.small { - font-size: 9px; -} -a { - color: #003399; -} -a:hover { - color: #888888; -} - - - - - - - . - - - Unit Test Results: <xsl:value-of select="$class.name"/> - - - - - - -

Class

- - - - - -
- -

Tests

- - - - - - - - - -
- - - -
- - - - - - - - Unit Test Classes: <xsl:value-of select="$name"/> - - - - - - - - - -
-

- - <none> -

-
- -

Classes

- - - - - - - -
- -
- - -
- - - - - - - All Unit Test Classes - - - - - -

Classes

- - - - -
- - -
- - - - - -
- - - / - .html - - - - - - - - - - - - - All Unit Test Packages - - - - - -

Home

-

Packages

- - - - -
- - -
- - - - - - - <none> - - - - - - - - - - Unit Test Results: Summary - - - - - - open('allclasses-frame.html','classListFrame') - -

Summary

- - - - - - - - - - - - - - - - - Error - Failure - Pass - - - - - - - - - -
TestsFailuresErrorsSuccess rateTime
- - - - - - - -
- - - - -
- Note: failures are anticipated and checked for with assertions while errors are unanticipated. -
- -

Packages

- - - - - - - - - - - Error - Failure - Pass - - - - - - - - - -
- - <none> - - - - -
- - - -
- - - - - - - - - - - - open('package-frame.html','classListFrame') - -

Package

- - - - - -

Classes

-

- - - - - -
-

-
- - - -
- - - - - - - ../ - - - - - - ../ - - - - - - - - stylesheet.css - - - - - -

Unit Test Results

- - - - - -
Designed for use with PHPUnit2 and Phing.
-
-
- - - - - - -

Report generated at
-
- - - - - Name - Tests - Errors - Failures - Time(s) - - - - - - - Name - Status - Type - Time(s) - - - - - - - - - - Error - Failure - Pass - - - - - - - - - - - - - - - - - - Error - Failure - TableRowColor - - - - - - Failure - - - - Error - - - - Success - - - - - - - - - - - - - - - - - - - - - - - - - N/A - - - - - -

- - - - - -
- - - - - - -
- - - -
- - - -
-
- - - - - - - - - - - - diff --git a/etc/style/phpunit2-noframes.xsl b/etc/style/phpunit2-noframes.xsl deleted file mode 100644 index d2c772da..00000000 --- a/etc/style/phpunit2-noframes.xsl +++ /dev/null @@ -1,436 +0,0 @@ - - - - - - - - - - - Unit Test Results - - - - - - - - -
- - - -
- - - -
- - - - - - - -
- - - - - - - - -

Packages

- Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers. - - - - - - - - - - - - - - - - - Failure - Error - - - - - - - - - -
- - - -
-
- - - - - - - - - - - - -

Package

- - - - - - -
- Back to top -

-

- - - - - - - - -

TestCase

- - - - - - - - - - -
-

- - Back to top - - - - -

Summary

- - - - - - - - - - - - - - - - - Failure - Error - - - - - - - - - -
TestsFailuresErrorsSuccess rateTime
- - - - - - - -
- - - - -
- Note: failures are anticipated and checked for with assertions while errors are unanticipated. -
-
- - - -

Unit Test Results

- - - - - -
Designed for use with PHPUnit2 and Phing.
-
-
- - - - - - -

Report generated at
-
- - - - Name - Tests - Errors - Failures - Time(s) - - - - - - - Name - Tests - Errors - Failures - Time(s) - - - - - - - Name - Status - Type - Time(s) - - - - - - - - - - - Failure - Error - - - - - - - - - - - - - - - - - - - - - Error - - - - - - Failure - - - - Error - - - - Success - - - - - - - - - - - - - - - - - - - - - - - - N/A - - - - - - -

- - - -
-
- - - - - - -
- - - -
- - - -
-
- - - - - - - - - - - -
- diff --git a/etc/style/str.replace.function.xsl b/etc/style/str.replace.function.xsl deleted file mode 100644 index 5d74e86c..00000000 --- a/etc/style/str.replace.function.xsl +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ERROR: function implementation of str:replace() relies on exsl:node-set(). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/unit/I18N/TNumberFormatTest.php b/tests/unit/I18N/TNumberFormatTest.php deleted file mode 100644 index 18e5f3ff..00000000 --- a/tests/unit/I18N/TNumberFormatTest.php +++ /dev/null @@ -1,103 +0,0 @@ -assertEquals($wanted, $formatter->format($number)); - - //currency - $wanted = 'US$123,456,789.13'; - $this->assertEquals($wanted, $formatter->format($number,'c')); - } - - function testLocalizedCurrencyFormats() { - $fr = new NumberFormat('fr'); - $de = new NumberFormat('de'); - $ja = new NumberFormat('ja_JP'); - - $number = '123456789.125156'; - - //french - $wanted = '123 456 789,13 F'; - $this->assertEquals($wanted, $fr->format($number,'c','FRF')); - - //german - $wanted = 'DES 123.456.789,13'; - $this->assertEquals($wanted, $de->format($number,'c','DES')); - - //japanese - $wanted = '¥123,456,789'; - $this->assertEquals($wanted, $ja->format($number,'c','JPY')); - - //custom/unkown currency - $wanted = 'DLL123,456,789'; - $this->assertEquals($wanted, $ja->format($number,'c','DLL')); - } - - function testCustomFormat() { - $formatter = new NumberFormat(); - $number = '123456789.125156'; - - //primay and secondary grouping test - $pattern = '#,###,##.###'; - $wanted = '1,234,567,89.125156'; - $this->assertEquals($wanted, $formatter->format($number, $pattern)); - - //4 digits grouping test - $pattern = '#,####.###'; - $wanted = '1,2345,6789.125156'; - $this->assertEquals($wanted, $formatter->format($number, $pattern)); - - //custom percentage - $pattern = '#,###.00%'; - $wanted = '123,456,789.13%'; - $this->assertEquals($wanted, $formatter->format($number, $pattern)); - } - - function testPercentageFormat() { - $formatter = new NumberFormat(); - $number = '0.125156'; - $wanted = '12%'; - $this->assertEquals($wanted, $formatter->format($number, 'p')); - } - - function testQuotes() { - $formatter = new NumberFormat(); - $number = '123456789.125156'; - - $pattern = "# o'clock"; - $wanted = "123456789 o'clock"; - $this->assertEquals($wanted, $formatter->format($number, $pattern)); - - } - - function testPadding() { - $formatter = new NumberFormat(); - $number = '5'; - - $pattern = '0000'; - $wanted = '0005'; - - //this should fail!!! - $this->assertNotEquals($wanted, $formatter->format($number, $pattern)); - } - - function testNegativeValue() { - $formatter = new NumberFormat(); - $number = "-1.2"; - - $wanted = "-1.2"; - $this->assertEquals($wanted, $formatter->format($number)); - } -} - -?> \ No newline at end of file diff --git a/tests/unit/I18N/core/CultureInfoTest.php b/tests/unit/I18N/core/CultureInfoTest.php new file mode 100644 index 00000000..14b60ece --- /dev/null +++ b/tests/unit/I18N/core/CultureInfoTest.php @@ -0,0 +1,81 @@ +culture = CultureInfo::getInvariantCulture(); + } + + function testCultureName() { + $name = 'en'; + + $this->assertEquals($name, $this->culture->Name); + + //the default/invariant culture should be neutral + $this->assertTrue($this->culture->IsNeutralCulture); + } + + function testCultureList() { + $allCultures = CultureInfo::getCultures(); + $neutralCultures = CultureInfo::getCultures(CultureInfo::NEUTRAL); + $specificCultures = CultureInfo::getCultures(CultureInfo::SPECIFIC); + + //there should be 246 cultures all together. + $this->assertEquals(count($allCultures),246); + $this->assertEquals(count($neutralCultures),76); + $this->assertEquals(count($specificCultures),170); + } + + function testParentCultures() { + $zh_CN = new CultureInfo('zh_CN'); + $parent = $zh_CN->Parent; + $grandparent = $parent->Parent; + + $this->assertEquals($zh_CN->Name, 'zh_CN'); + $this->assertEquals($parent->Name, 'zh'); + $this->assertEquals($grandparent->Name, 'en'); + $this->assertEquals($grandparent->Parent->Name, 'en'); + } + + function testCountryNames() { + $culture = new CultureInfo('fr_FR'); + $this->assertEquals($culture->Countries['AE'], 'Émirats arabes unis'); + } + + function testCurrencies() { + $culture = new CultureInfo('en_AU'); + $au = array('$', 'Australian Dollar'); + $this->assertEquals($au, $culture->Currencies['AUD']); + } + + function testLanguages() { + $culture = new CultureInfo('fr_BE'); + $this->assertEquals($culture->Languages['fr'], 'français'); + } + + function testScripts() { + $culture = new CultureInfo('fr'); + $this->assertEquals($culture->Scripts['Armn'], 'arménien'); + } + + function testTimeZones() { + $culture = new CultureInfo('fi'); + $zone = array( + "America/Los_Angeles", + "Tyynenmeren normaaliaika", + "PST", + "Tyynenmeren kesäaika", + "PDT", + "Los Angeles"); + $this->assertEquals($culture->TimeZones[1],$zone); + } +} + +?> \ No newline at end of file diff --git a/tests/unit/I18N/core/NumberFormatInfoTest.php b/tests/unit/I18N/core/NumberFormatInfoTest.php new file mode 100644 index 00000000..a3b6d05a --- /dev/null +++ b/tests/unit/I18N/core/NumberFormatInfoTest.php @@ -0,0 +1,88 @@ +assertEquals($numberInfo->DecimalDigits,2); + $this->assertEquals($numberInfo->DecimalSeparator,'.'); + $this->assertEquals($numberInfo->GroupSeparator,','); + + //there should be only 1 grouping of size 3 + $groupsize = array(3,false); + $this->assertEquals($numberInfo->GroupSizes, $groupsize); + + //the default negative pattern prefix and postfix + $negPattern = array('-¤',''); + $this->assertEquals($numberInfo->NegativePattern, $negPattern); + + //the default positive pattern prefix and postfix + $negPattern = array('¤',''); + $this->assertEquals($numberInfo->PositivePattern, $negPattern); + + //the default currency symbol + $this->assertEquals($numberInfo->CurrencySymbol, 'US$'); + $this->assertEquals($numberInfo->getCurrencySymbol('JPY'), '¥'); + $this->assertEquals($numberInfo->NegativeInfinitySymbol, '-∞'); + $this->assertEquals($numberInfo->PositiveInfinitySymbol, '+∞'); + $this->assertEquals($numberInfo->NegativeSign, '-'); + $this->assertEquals($numberInfo->PositiveSign, '+'); + $this->assertEquals($numberInfo->NaNSymbol, '�'); + $this->assertEquals($numberInfo->PercentSymbol, '%'); + $this->assertEquals($numberInfo->PerMilleSymbol, '‰'); + } + + function testPatternsSet() { + $numberInfo = NumberFormatInfo::getInstance(); + + $numberInfo->DecimalDigits = 0; + $this->assertEquals($numberInfo->DecimalDigits,0); + + $numberInfo->DecimalSeparator = ','; + $this->assertEquals($numberInfo->DecimalSeparator,','); + + $numberInfo->GroupSeparator = ' '; + $this->assertEquals($numberInfo->GroupSeparator,' '); + + $numberInfo->GroupSizes = array(2,3); + $groupsize = array(2,3); + $this->assertEquals($numberInfo->GroupSizes, $groupsize); + + $numberInfo->NegativePattern = array('-$$','.'); + $negPattern = array('-$$','.'); + $this->assertEquals($numberInfo->NegativePattern, $negPattern); + + $numberInfo->PositivePattern = array('YY','.'); + $negPattern = array('YY','.'); + $this->assertEquals($numberInfo->PositivePattern, $negPattern); + + //the default CurrencySymbol symbol + $numberInfo->CurrencySymbol = '$$$'; + $this->assertEquals($numberInfo->CurrencySymbol, '$$$'); + } + + function testLocalizedPatterns() { + $fr = NumberFormatInfo::getInstance('fr'); + $de = NumberFormatInfo::getInstance('de'); + $en = NumberFormatInfo::getInstance('en_US'); + + $this->assertEquals($fr->DecimalSeparator, ','); + $this->assertEquals($de->DecimalSeparator, ','); + $this->assertEquals($en->DecimalSeparator, '.'); + + $this->assertEquals($fr->GroupSeparator, ' '); + $this->assertEquals($de->GroupSeparator, '.'); + $this->assertEquals($en->GroupSeparator, ','); + } +} + +?> \ No newline at end of file diff --git a/tests/unit/I18N/core/NumberFormatTest.php b/tests/unit/I18N/core/NumberFormatTest.php new file mode 100644 index 00000000..af6a06ca --- /dev/null +++ b/tests/unit/I18N/core/NumberFormatTest.php @@ -0,0 +1,111 @@ +assertEquals($wanted, $formatter->format($number)); + + //currency + $wanted = 'US$123,456,789.13'; + $this->assertEquals($wanted, $formatter->format($number,'c')); + } + + function testLocalizedCurrencyFormats() { + $fr = new NumberFormat('fr'); + $de = new NumberFormat('de'); + $ja = new NumberFormat('ja_JP'); + + $number = '123456789.125156'; + + //french + $wanted = '123 456 789,13 F'; + $this->assertEquals($wanted, $fr->format($number,'c','FRF')); + + //german + $wanted = 'DES 123.456.789,13'; + $this->assertEquals($wanted, $de->format($number,'c','DES')); + + //japanese + $wanted = '¥123,456,789'; + $this->assertEquals($wanted, $ja->format($number,'c','JPY')); + + //custom/unkown currency + $wanted = 'DLL123,456,789'; + $this->assertEquals($wanted, $ja->format($number,'c','DLL')); + } + + function testCustomFormat() { + $formatter = new NumberFormat(); + $number = '123456789.125156'; + + //primay and secondary grouping test + $pattern = '#,###,##.###'; + $wanted = '1,234,567,89.125156'; + $this->assertEquals($wanted, $formatter->format($number, $pattern)); + + //4 digits grouping test + $pattern = '#,####.###'; + $wanted = '1,2345,6789.125156'; + $this->assertEquals($wanted, $formatter->format($number, $pattern)); + + //custom percentage + $pattern = '#,###.00%'; + $wanted = '123,456,789.13%'; + $this->assertEquals($wanted, $formatter->format($number, $pattern)); + } + + function testPercentageFormat() { + $formatter = new NumberFormat(); + $number = '0.125156'; + $wanted = '12%'; + $this->assertEquals($wanted, $formatter->format($number, 'p')); + } + + function testQuotes() { + $formatter = new NumberFormat(); + $number = '123456789.125156'; + + $pattern = "# o'clock"; + $wanted = "123456789 o'clock"; + $this->assertEquals($wanted, $formatter->format($number, $pattern)); + + } + + function testPadding() { + $formatter = new NumberFormat(); + $number = '5'; + + $pattern = '0000'; + $wanted = '0005'; + + //this should fail!!! + $this->assertNotEquals($wanted, $formatter->format($number, $pattern)); + } + + function testFormatWithANegativeValue() { + $formatter = new NumberFormat(); + $number = "-1.2"; + + $wanted = "-1.2"; + $this->assertEquals($wanted, $formatter->format($number)); + } + + public function testFormatWithAScientificPattern() { + $formatter = new NumberFormat(); + $number = "10"; + $expected = "10E"; + $this->assertEquals('10E', $formatter->format($number, 'e')); + } + +} + +?> \ No newline at end of file -- cgit v1.2.3