From 376a5af2d258f87e2be75b667850436987c68a55 Mon Sep 17 00:00:00 2001 From: knut <> Date: Tue, 29 May 2007 20:29:10 +0000 Subject: upgraded unit test suite to use PHPUnit3 use "cd tests/; phpunit AllTests.php" to run the tests use "cd tests/; phpunit --report=coverage AllTests.php" to get a nice code coverage report (need xdebug) --- .gitattributes | 8 +- tests/unit/AllTests.php | 39 ++++++++++ tests/unit/Collections/AllTests.php | 29 ++++++++ tests/unit/Collections/TListTest.php | 4 +- tests/unit/Collections/TMapTest.php | 4 +- tests/unit/Data/TDbTransactionTest.php | 4 +- tests/unit/I18N/core/AllTests.php | 35 +++++++++ tests/unit/I18N/core/CultureInfoTest.php | 4 +- tests/unit/I18N/core/DateFormatTest.php | 4 +- tests/unit/I18N/core/DateTimeFormatInfoTest.php | 4 +- tests/unit/I18N/core/NumberFormatInfoTest.php | 4 +- tests/unit/I18N/core/NumberFormatTest.php | 4 +- tests/unit/TComponentTest.php | 4 +- tests/unit/Web/AllTests.php | 41 +++++++++++ tests/unit/Web/TAssetManagerTest.php | 14 ++-- tests/unit/Web/THttpCookieCollectionTest.php | 14 ++-- tests/unit/Web/THttpCookieTest.php | 18 ++--- tests/unit/Web/THttpRequestTest.php | 86 +++++++++++----------- tests/unit/Web/THttpResponseTest.php | 46 ++++++------ tests/unit/Web/THttpSessionTest.php | 56 +++++++------- tests/unit/Web/THttpUtilityTest.php | 8 +- tests/unit/Web/TUriTest.php | 24 +++--- tests/unit/Web/UI/WebControls/AllTests.php | 33 +++++++++ .../unit/Web/UI/WebControls/TDropDownListTest.php | 4 +- tests/unit/Web/UI/WebControls/TLabelTest.php | 4 +- .../UI/WebControls/TRequiredFieldValidatorTest.php | 4 +- .../unit/Web/UI/WebControls/TXmlTransformTest.php | 8 +- tests/unit/Xml/AllTests.php | 31 ++++++++ tests/unit/Xml/TRssFeedDocumentTest.php | 4 +- tests/unit/Xml/TXmlDocumentTest.php | 16 ++-- tests/unit/Xml/TXmlElementListTest.php | 10 +-- tests/unit/Xml/TXmlElementTest.php | 20 ++--- tests/unit/phpunit.php | 21 ++++++ tests/unit/phpunit2.php | 18 ----- 34 files changed, 422 insertions(+), 205 deletions(-) create mode 100644 tests/unit/AllTests.php create mode 100644 tests/unit/Collections/AllTests.php create mode 100644 tests/unit/I18N/core/AllTests.php create mode 100644 tests/unit/Web/AllTests.php create mode 100644 tests/unit/Web/UI/WebControls/AllTests.php create mode 100644 tests/unit/Xml/AllTests.php create mode 100644 tests/unit/phpunit.php delete mode 100644 tests/unit/phpunit2.php diff --git a/.gitattributes b/.gitattributes index 85c7e436..df3eb8d5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2792,14 +2792,17 @@ tests/test_tools/simpletest/reflection_php5.php -text tests/test_tools/simpletest/selector.php -text tests/test_tools/simpletest/simpletest.php -text tests/test_tools/simpletest/test_case.php -text +tests/unit/AllTests.php -text tests/unit/Caching/TDirectoryCacheDependencyTest.php -text tests/unit/Caching/TFileCacheDependencyTest.php -text +tests/unit/Collections/AllTests.php -text tests/unit/Collections/TListTest.php -text tests/unit/Collections/TMapTest.php -text tests/unit/Data/TDbCommandTest.php -text tests/unit/Data/TDbConnectionTest.php -text tests/unit/Data/TDbDataReaderTest.php -text tests/unit/Data/TDbTransactionTest.php -text +tests/unit/I18N/core/AllTests.php -text tests/unit/I18N/core/CultureInfoTest.php -text tests/unit/I18N/core/DateFormatTest.php -text tests/unit/I18N/core/DateTimeFormatInfoTest.php -text @@ -2918,6 +2921,7 @@ tests/unit/SQLMap/sqlite/backup.db -text tests/unit/SQLMap/sqlite/tests.db -text tests/unit/TComponentTest.php -text tests/unit/Util/DateTimeStampTestCase.php -text +tests/unit/Web/AllTests.php -text tests/unit/Web/TAssetManagerTest.php -text tests/unit/Web/THttpCookieCollectionTest.php -text tests/unit/Web/THttpCookieTest.php -text @@ -2926,14 +2930,16 @@ tests/unit/Web/THttpResponseTest.php -text tests/unit/Web/THttpSessionTest.php -text tests/unit/Web/THttpUtilityTest.php -text tests/unit/Web/TUriTest.php -text +tests/unit/Web/UI/WebControls/AllTests.php -text tests/unit/Web/UI/WebControls/TDropDownListTest.php -text tests/unit/Web/UI/WebControls/TLabelTest.php -text tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php -text tests/unit/Web/UI/WebControls/TXmlTransformTest.php -text tests/unit/Web/UI/WebControls/data/hello.xml -text tests/unit/Web/UI/WebControls/data/hello.xsl -text +tests/unit/Xml/AllTests.php -text tests/unit/Xml/TRssFeedDocumentTest.php -text tests/unit/Xml/TXmlDocumentTest.php -text tests/unit/Xml/TXmlElementListTest.php -text tests/unit/Xml/TXmlElementTest.php -text -tests/unit/phpunit2.php -text +tests/unit/phpunit.php -text diff --git a/tests/unit/AllTests.php b/tests/unit/AllTests.php new file mode 100644 index 00000000..38096801 --- /dev/null +++ b/tests/unit/AllTests.php @@ -0,0 +1,39 @@ +addTest(Xml_AllTests::suite()); + $suite->addTest(Collections_AllTests::suite()); + $suite->addTest(I18N_core_AllTests::suite()); + $suite->addTest(Web_AllTests::suite()); + $suite->addTest(Web_UI_WebControls_AllTests::suite()); + + $suite->addTestSuite('TComponentTest'); + + return $suite; + } +} + +if(PHPUnit_MAIN_METHOD == 'AllTests::main') { + AllTests::main(); +} +?> diff --git a/tests/unit/Collections/AllTests.php b/tests/unit/Collections/AllTests.php new file mode 100644 index 00000000..c9da9132 --- /dev/null +++ b/tests/unit/Collections/AllTests.php @@ -0,0 +1,29 @@ +addTestSuite('TListTest'); + $suite->addTestSuite('TMapTest'); + + return $suite; + } +} + +if(PHPUnit_MAIN_METHOD == 'Collections_AllTests::main') { + Collections_AllTests::main(); +} +?> diff --git a/tests/unit/Collections/TListTest.php b/tests/unit/Collections/TListTest.php index e090728c..1750d743 100644 --- a/tests/unit/Collections/TListTest.php +++ b/tests/unit/Collections/TListTest.php @@ -1,5 +1,5 @@ addTestSuite('CultureInfoTest'); + $suite->addTestSuite('DateFormatTest'); + $suite->addTestSuite('DateTimeFormatInfoTest'); + $suite->addTestSuite('NumberFormatInfoTest'); + $suite->addTestSuite('NumberFormatTest'); + + return $suite; + } +} + +if(PHPUnit_MAIN_METHOD == 'I18N_core_AllTests::main') { + I18N_core_AllTests::main(); +} +?> diff --git a/tests/unit/I18N/core/CultureInfoTest.php b/tests/unit/I18N/core/CultureInfoTest.php index 14b60ece..c043edd7 100644 --- a/tests/unit/I18N/core/CultureInfoTest.php +++ b/tests/unit/I18N/core/CultureInfoTest.php @@ -1,12 +1,12 @@ addTestSuite('TAssetManagerTest'); + $suite->addTestSuite('THttpCookieCollectionTest'); + $suite->addTestSuite('THttpCookieTest'); + $suite->addTestSuite('THttpRequestTest'); + $suite->addTestSuite('THttpResponseTest'); + $suite->addTestSuite('THttpSessionTest'); + $suite->addTestSuite('THttpUtilityTest'); + $suite->addTestSuite('TUriTest'); + + return $suite; + } +} + +if(PHPUnit_MAIN_METHOD == 'Web_AllTests::main') { + Web_AllTests::main(); +} +?> diff --git a/tests/unit/Web/TAssetManagerTest.php b/tests/unit/Web/TAssetManagerTest.php index 1821f28b..49d42165 100644 --- a/tests/unit/Web/TAssetManagerTest.php +++ b/tests/unit/Web/TAssetManagerTest.php @@ -1,31 +1,31 @@ \ No newline at end of file diff --git a/tests/unit/Web/THttpCookieCollectionTest.php b/tests/unit/Web/THttpCookieCollectionTest.php index 28b32a6e..9c648e2b 100644 --- a/tests/unit/Web/THttpCookieCollectionTest.php +++ b/tests/unit/Web/THttpCookieCollectionTest.php @@ -1,31 +1,31 @@ \ No newline at end of file diff --git a/tests/unit/Web/THttpCookieTest.php b/tests/unit/Web/THttpCookieTest.php index ab7d4928..8a96e35e 100644 --- a/tests/unit/Web/THttpCookieTest.php +++ b/tests/unit/Web/THttpCookieTest.php @@ -1,39 +1,39 @@ \ No newline at end of file diff --git a/tests/unit/Web/THttpRequestTest.php b/tests/unit/Web/THttpRequestTest.php index a27eb711..0933fb05 100644 --- a/tests/unit/Web/THttpRequestTest.php +++ b/tests/unit/Web/THttpRequestTest.php @@ -1,175 +1,175 @@ \ No newline at end of file diff --git a/tests/unit/Web/THttpResponseTest.php b/tests/unit/Web/THttpResponseTest.php index 9812c3a6..54d25830 100644 --- a/tests/unit/Web/THttpResponseTest.php +++ b/tests/unit/Web/THttpResponseTest.php @@ -1,95 +1,95 @@ \ No newline at end of file diff --git a/tests/unit/Web/THttpSessionTest.php b/tests/unit/Web/THttpSessionTest.php index 8f30cfa6..179d2903 100644 --- a/tests/unit/Web/THttpSessionTest.php +++ b/tests/unit/Web/THttpSessionTest.php @@ -1,115 +1,115 @@ \ No newline at end of file diff --git a/tests/unit/Web/THttpUtilityTest.php b/tests/unit/Web/THttpUtilityTest.php index 790bc9f6..4dfc46bd 100644 --- a/tests/unit/Web/THttpUtilityTest.php +++ b/tests/unit/Web/THttpUtilityTest.php @@ -1,19 +1,19 @@ \ No newline at end of file diff --git a/tests/unit/Web/TUriTest.php b/tests/unit/Web/TUriTest.php index b606bdc3..fb803d8b 100644 --- a/tests/unit/Web/TUriTest.php +++ b/tests/unit/Web/TUriTest.php @@ -1,51 +1,51 @@ \ No newline at end of file diff --git a/tests/unit/Web/UI/WebControls/AllTests.php b/tests/unit/Web/UI/WebControls/AllTests.php new file mode 100644 index 00000000..f9b188c2 --- /dev/null +++ b/tests/unit/Web/UI/WebControls/AllTests.php @@ -0,0 +1,33 @@ +addTestSuite('TDropDownListTest'); + $suite->addTestSuite('TLabelTest'); + $suite->addTestSuite('TRequiredFieldValidatorTest'); + $suite->addTestSuite('TXmlTransformTest'); + + return $suite; + } +} + +if(PHPUnit_MAIN_METHOD == 'Web_UI_WebControls_AllTests::main') { + Web_UI_WebControls_AllTests::main(); +} +?> diff --git a/tests/unit/Web/UI/WebControls/TDropDownListTest.php b/tests/unit/Web/UI/WebControls/TDropDownListTest.php index b93d32cf..3db425b9 100644 --- a/tests/unit/Web/UI/WebControls/TDropDownListTest.php +++ b/tests/unit/Web/UI/WebControls/TDropDownListTest.php @@ -1,12 +1,12 @@ addTestSuite('TXmlDocumentTest'); + $suite->addTestSuite('TXmlElementTest'); + $suite->addTestSuite('TXmlElementListTest'); + + return $suite; + } +} + +if(PHPUnit_MAIN_METHOD == 'Xml_AllTests::main') { + Xml_AllTests::main(); +} +?> diff --git a/tests/unit/Xml/TRssFeedDocumentTest.php b/tests/unit/Xml/TRssFeedDocumentTest.php index ad6bf7dc..e49b5eca 100644 --- a/tests/unit/Xml/TRssFeedDocumentTest.php +++ b/tests/unit/Xml/TRssFeedDocumentTest.php @@ -1,12 +1,12 @@ \ No newline at end of file diff --git a/tests/unit/Xml/TXmlElementListTest.php b/tests/unit/Xml/TXmlElementListTest.php index cfebf095..eb91c46f 100644 --- a/tests/unit/Xml/TXmlElementListTest.php +++ b/tests/unit/Xml/TXmlElementListTest.php @@ -1,23 +1,23 @@ \ No newline at end of file diff --git a/tests/unit/Xml/TXmlElementTest.php b/tests/unit/Xml/TXmlElementTest.php index 41431633..eec22b1f 100644 --- a/tests/unit/Xml/TXmlElementTest.php +++ b/tests/unit/Xml/TXmlElementTest.php @@ -1,46 +1,46 @@ \ No newline at end of file diff --git a/tests/unit/phpunit.php b/tests/unit/phpunit.php new file mode 100644 index 00000000..54e731b6 --- /dev/null +++ b/tests/unit/phpunit.php @@ -0,0 +1,21 @@ + diff --git a/tests/unit/phpunit2.php b/tests/unit/phpunit2.php deleted file mode 100644 index 8d9c8d0d..00000000 --- a/tests/unit/phpunit2.php +++ /dev/null @@ -1,18 +0,0 @@ - -- cgit v1.2.3