From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .gitattributes | 962 ---- buildscripts/Benchmark/Iterate.php | 334 +- buildscripts/Benchmark/Profiler.php | 894 ++-- buildscripts/Benchmark/Timer.php | 638 +-- buildscripts/Benchmark/doc/timer_example.php | 36 +- .../PHPUnit2/Extensions/ExceptionTestCase.php | 244 +- .../PHPUnit2/Extensions/PerformanceTestCase.php | 256 +- buildscripts/PHPUnit2/Extensions/RepeatedTest.php | 276 +- buildscripts/PHPUnit2/Extensions/TestDecorator.php | 348 +- buildscripts/PHPUnit2/Extensions/TestSetup.php | 308 +- buildscripts/PHPUnit2/Framework/Assert.php | 1252 ++--- .../PHPUnit2/Framework/AssertionFailedError.php | 160 +- .../PHPUnit2/Framework/ComparisonFailure.php | 306 +- buildscripts/PHPUnit2/Framework/Error.php | 176 +- buildscripts/PHPUnit2/Framework/IncompleteTest.php | 144 +- .../PHPUnit2/Framework/IncompleteTestError.php | 150 +- buildscripts/PHPUnit2/Framework/Test.php | 174 +- buildscripts/PHPUnit2/Framework/TestCase.php | 584 +-- buildscripts/PHPUnit2/Framework/TestFailure.php | 308 +- buildscripts/PHPUnit2/Framework/TestListener.php | 270 +- buildscripts/PHPUnit2/Framework/TestResult.php | 894 ++-- buildscripts/PHPUnit2/Framework/TestSuite.php | 1108 ++--- buildscripts/PHPUnit2/Framework/Warning.php | 188 +- buildscripts/PHPUnit2/Runner/BaseTestRunner.php | 566 +-- .../PHPUnit2/Runner/IncludePathTestCollector.php | 368 +- .../PHPUnit2/Runner/StandardTestSuiteLoader.php | 258 +- buildscripts/PHPUnit2/Runner/TestCollector.php | 154 +- buildscripts/PHPUnit2/Runner/TestSuiteLoader.php | 170 +- buildscripts/PHPUnit2/Runner/Version.php | 180 +- buildscripts/PHPUnit2/TextUI/ResultPrinter.php | 712 +-- buildscripts/PHPUnit2/TextUI/TestRunner.php | 1244 ++--- .../PHPUnit2/Util/CodeCoverage/Renderer.php | 450 +- .../PHPUnit2/Util/CodeCoverage/Renderer/HTML.php | 382 +- .../PHPUnit2/Util/CodeCoverage/Renderer/Text.php | 250 +- buildscripts/PHPUnit2/Util/ErrorHandler.php | 154 +- buildscripts/PHPUnit2/Util/Fileloader.php | 218 +- buildscripts/PHPUnit2/Util/Filter.php | 526 +-- buildscripts/PHPUnit2/Util/Log/PEAR.php | 440 +- buildscripts/PHPUnit2/Util/Log/XML.php | 712 +-- buildscripts/PHPUnit2/Util/Printer.php | 232 +- buildscripts/PHPUnit2/Util/Skeleton.php | 680 +-- .../PHPUnit2/Util/TestDox/NamePrettifier.php | 330 +- .../PHPUnit2/Util/TestDox/ResultPrinter.php | 598 +-- .../PHPUnit2/Util/TestDox/ResultPrinter/HTML.php | 240 +- .../PHPUnit2/Util/TestDox/ResultPrinter/Text.php | 204 +- buildscripts/chmbuilder/ChmQuickstartBuilder.php | 876 ++-- buildscripts/chmbuilder/build.php | 158 +- buildscripts/chmbuilder/build_child.php | 12 +- buildscripts/chmbuilder/classes/pages/ClassDoc.php | 456 +- buildscripts/chmbuilder/classes/pages/Classes.php | 38 +- .../chmbuilder/classes/pages/MainLayout.php | 14 +- buildscripts/chmbuilder/index.php | 12 +- buildscripts/classtree/DWExtension.php | 508 +-- buildscripts/classtree/build.php | 516 +-- buildscripts/index/api_index.php | 240 +- buildscripts/index/build.php | 130 +- buildscripts/index/quickstart_index.php | 212 +- buildscripts/index/search.php | 70 +- buildscripts/jGrouseDoc/skins/common/js/jgdoc.js | 478 +- buildscripts/jGrouseDoc/skins/common/js/jgindex.js | 192 +- buildscripts/jGrouseDoc/skins/common/js/navTree.js | 426 +- buildscripts/jGrouseDoc/skins/noframes/js/jgdoc.js | 650 +-- .../jGrouseDoc/skins/noframes/js/navTree.js | 818 ++-- .../phing/tasks/ext/ioncube/IoncubeComment.php | 86 +- .../simpletest/SimpleTestCountResultFormatter.php | 102 +- .../ext/simpletest/SimpleTestFormatterElement.php | 250 +- .../simpletest/SimpleTestPlainResultFormatter.php | 188 +- .../ext/simpletest/SimpleTestResultFormatter.php | 322 +- .../SimpleTestSummaryResultFormatter.php | 106 +- .../classes/phing/tasks/ext/svn/SvnBaseTask.php | 358 +- .../system/condition/ReferenceExistsCondition.php | 104 +- buildscripts/phing/tasks/ManualIndexTask.php | 74 +- buildscripts/phing/tasks/PradoDocTask.php | 296 +- buildscripts/phing/tasks/PradoPackageTask.php | 280 +- buildscripts/phing/tasks/PradoQuickStartDocs.php | 168 +- buildscripts/phing/tasks/PradoSimpleTestTask.php | 78 +- buildscripts/phing/tasks/PradoTestTask.php | 34 +- buildscripts/phing/tasks/QuickstartIndexTask.php | 62 +- buildscripts/phpbuilder/build.php | 294 +- buildscripts/texbuilder/Page2Tex.php | 694 +-- buildscripts/texbuilder/quickstart/build.php | 162 +- buildscripts/texbuilder/quickstart/pages.php | 356 +- buildscripts/texbuilder/sqlmap/build.php | 162 +- buildscripts/texbuilder/sqlmap/pages.php | 122 +- buildscripts/texbuilder/time-tracker/pages.php | 34 +- demos/address-book/index.php | 52 +- .../protected/pages/AddressProvider.php | 96 +- .../address-book/protected/pages/AddressRecord.php | 68 +- demos/address-book/protected/pages/FlexApp.php | 226 +- .../protected/pages/flex/bin/AC_OETags.js | 538 +-- .../protected/pages/flex/bin/history.js | 96 +- .../pages/flex/html-template/AC_OETags.js | 538 +-- .../protected/pages/flex/html-template/history.js | 96 +- demos/blog-tutorial/index.php | 34 +- demos/blog-tutorial/protected/common/InfoBox.php | 24 +- demos/blog-tutorial/protected/common/NoteBox.php | 24 +- demos/blog-tutorial/protected/common/TipBox.php | 24 +- demos/blog-tutorial/protected/common/TopicList.php | 14 +- .../blog-tutorial/protected/layout/MainLayout.php | 12 +- demos/blog-tutorial/samples/day1/blog/index.php | 42 +- .../day1/blog/protected/layouts/MainLayout.php | 12 +- .../samples/day1/blog/protected/pages/Contact.php | 58 +- demos/blog-tutorial/samples/day2/blog/index.php | 42 +- .../day2/blog/protected/database/PostRecord.php | 54 +- .../day2/blog/protected/database/UserRecord.php | 54 +- .../day2/blog/protected/layouts/MainLayout.php | 12 +- .../samples/day2/blog/protected/pages/Contact.php | 58 +- demos/blog-tutorial/samples/day3/blog/index.php | 42 +- .../samples/day3/blog/protected/BlogUser.php | 116 +- .../day3/blog/protected/database/PostRecord.php | 54 +- .../day3/blog/protected/database/UserRecord.php | 54 +- .../day3/blog/protected/layouts/MainLayout.php | 36 +- .../samples/day3/blog/protected/pages/Contact.php | 58 +- .../day3/blog/protected/pages/users/AdminUser.php | 70 +- .../day3/blog/protected/pages/users/EditUser.php | 164 +- .../day3/blog/protected/pages/users/LoginUser.php | 72 +- .../day3/blog/protected/pages/users/NewUser.php | 88 +- demos/blog-tutorial/samples/day4/blog/index.php | 42 +- .../samples/day4/blog/protected/BlogUser.php | 116 +- .../day4/blog/protected/database/PostRecord.php | 54 +- .../day4/blog/protected/database/UserRecord.php | 54 +- .../day4/blog/protected/layouts/MainLayout.php | 36 +- .../samples/day4/blog/protected/pages/Contact.php | 58 +- .../day4/blog/protected/pages/posts/EditPost.php | 142 +- .../day4/blog/protected/pages/posts/ListPost.php | 126 +- .../day4/blog/protected/pages/posts/NewPost.php | 66 +- .../blog/protected/pages/posts/PostRenderer.php | 12 +- .../day4/blog/protected/pages/posts/ReadPost.php | 112 +- .../day4/blog/protected/pages/users/AdminUser.php | 70 +- .../day4/blog/protected/pages/users/EditUser.php | 164 +- .../day4/blog/protected/pages/users/LoginUser.php | 72 +- .../day4/blog/protected/pages/users/NewUser.php | 88 +- demos/blog-tutorial/samples/day5/blog/index.php | 42 +- .../day5/blog/protected/BlogErrorHandler.php | 78 +- .../samples/day5/blog/protected/BlogException.php | 12 +- .../samples/day5/blog/protected/BlogUser.php | 116 +- .../day5/blog/protected/database/PostRecord.php | 54 +- .../day5/blog/protected/database/UserRecord.php | 54 +- .../day5/blog/protected/layouts/MainLayout.php | 36 +- .../samples/day5/blog/protected/pages/Contact.php | 58 +- .../day5/blog/protected/pages/posts/EditPost.php | 142 +- .../day5/blog/protected/pages/posts/ListPost.php | 126 +- .../day5/blog/protected/pages/posts/NewPost.php | 66 +- .../blog/protected/pages/posts/PostRenderer.php | 12 +- .../day5/blog/protected/pages/posts/ReadPost.php | 116 +- .../day5/blog/protected/pages/users/AdminUser.php | 70 +- .../day5/blog/protected/pages/users/EditUser.php | 164 +- .../day5/blog/protected/pages/users/LoginUser.php | 72 +- .../day5/blog/protected/pages/users/NewUser.php | 88 +- demos/blog/index.php | 40 +- demos/blog/protected/Common/BlogDataModule.php | 1414 +++--- demos/blog/protected/Common/BlogErrorHandler.php | 90 +- demos/blog/protected/Common/BlogException.php | 60 +- demos/blog/protected/Common/BlogPage.php | 96 +- demos/blog/protected/Common/BlogUser.php | 118 +- demos/blog/protected/Common/BlogUserManager.php | 188 +- demos/blog/protected/Common/XListMenu.php | 252 +- demos/blog/protected/Layouts/MainLayout.php | 46 +- demos/blog/protected/Pages/Admin/AdminMenu.php | 46 +- demos/blog/protected/Pages/Admin/ConfigMan.php | 152 +- demos/blog/protected/Pages/Admin/PostMan.php | 144 +- demos/blog/protected/Pages/Admin/UserMan.php | 148 +- demos/blog/protected/Pages/ErrorReport.php | 56 +- demos/blog/protected/Pages/Posts/EditCategory.php | 120 +- demos/blog/protected/Pages/Posts/EditPost.php | 154 +- demos/blog/protected/Pages/Posts/ListPost.php | 282 +- demos/blog/protected/Pages/Posts/MyPost.php | 100 +- demos/blog/protected/Pages/Posts/NewCategory.php | 80 +- demos/blog/protected/Pages/Posts/NewPost.php | 112 +- demos/blog/protected/Pages/Posts/ViewPost.php | 178 +- demos/blog/protected/Pages/SearchPost.php | 134 +- demos/blog/protected/Pages/Users/EditUser.php | 136 +- demos/blog/protected/Pages/Users/NewUser.php | 114 +- demos/blog/protected/Pages/Users/ViewUser.php | 82 +- demos/blog/protected/Portlets/AccountPortlet.php | 60 +- demos/blog/protected/Portlets/ArchivePortlet.php | 122 +- demos/blog/protected/Portlets/CategoryPortlet.php | 74 +- demos/blog/protected/Portlets/CommentPortlet.php | 78 +- demos/blog/protected/Portlets/LoginPortlet.php | 76 +- demos/blog/protected/Portlets/Portlet.php | 46 +- demos/blog/protected/Portlets/SearchPortlet.php | 76 +- demos/chat/index.php | 56 +- demos/chat/protected/App_Code/ChatBufferRecord.php | 126 +- demos/chat/protected/App_Code/ChatUserManager.php | 168 +- demos/chat/protected/App_Code/ChatUserRecord.php | 80 +- demos/chat/protected/pages/Home.php | 110 +- demos/chat/protected/pages/Login.php | 78 +- demos/composer/index.php | 34 +- demos/composer/index2.php | 34 +- demos/composer/protected/pages/ClassDefinition.php | 740 +-- demos/composer/protected/pages/Home.php | 234 +- demos/composer/protected/pages/Layout.php | 28 +- demos/helloworld/index.php | 34 +- demos/helloworld/protected/pages/Home.php | 20 +- demos/northwind-db/index.php | 54 +- demos/northwind-db/protected/database/Category.php | 50 +- demos/northwind-db/protected/database/Customer.php | 64 +- demos/northwind-db/protected/database/Employee.php | 94 +- demos/northwind-db/protected/database/Order.php | 82 +- .../protected/database/OrderDetail.php | 52 +- demos/northwind-db/protected/database/Product.php | 70 +- demos/northwind-db/protected/database/Region.php | 48 +- demos/northwind-db/protected/database/Shipper.php | 48 +- demos/northwind-db/protected/database/Supplier.php | 66 +- .../northwind-db/protected/database/Territory.php | 118 +- .../northwind-db/protected/pages/NorthwindCrud.php | 54 +- demos/personal/index.php | 28 +- demos/personal/protected/Common/LoginPortlet.php | 36 +- demos/personal/protected/Common/MainMenu.php | 22 +- demos/personal/protected/Pages/Layout.php | 12 +- demos/personal/protected/Pages/Register.php | 36 +- demos/quickstart/index.php | 34 +- demos/quickstart/index2.php | 34 +- .../protected/QuickStartGlobalization.php | 60 +- .../protected/controls/Comments/CommentBlock.php | 212 +- .../protected/controls/Comments/comments.js | 412 +- demos/quickstart/protected/controls/DocLink.php | 60 +- demos/quickstart/protected/controls/Layout.php | 94 +- .../protected/controls/RequiresVersion.php | 30 +- demos/quickstart/protected/controls/RunBar.php | 44 +- .../quickstart/protected/controls/SampleLayout.php | 24 +- demos/quickstart/protected/controls/SearchBox.php | 80 +- .../quickstart/protected/controls/SinceVersion.php | 30 +- demos/quickstart/protected/controls/TopicList.php | 14 +- demos/quickstart/protected/index/ZendSearch.php | 108 +- .../ActiveControls/Samples/TActiveButton/Home.php | 38 +- .../Samples/TActiveCheckBox/Home.php | 30 +- .../Samples/TActiveCheckBoxList/Home.php | 50 +- .../Samples/TActiveCustomValidator/Home.php | 20 +- .../Samples/TActiveDataGrid/Sample1.php | 72 +- .../Samples/TActiveDataGrid/Sample2.php | 170 +- .../Samples/TActiveDataGrid/Sample3.php | 378 +- .../Samples/TActiveDataGrid/Sample4.php | 40 +- .../Samples/TActiveDataGrid/Sample5.php | 156 +- .../Samples/TActiveDataList/Home.php | 262 +- .../Samples/TActiveDropDownList/Home.php | 118 +- .../Samples/TActiveFileUpload/Home.php | 40 +- .../Samples/TActiveHyperLink/Home.php | 50 +- .../ActiveControls/Samples/TActiveImage/Home.php | 32 +- .../Samples/TActiveImageButton/Home.php | 34 +- .../Samples/TActiveLinkButton/Home.php | 26 +- .../ActiveControls/Samples/TActiveListBox/Home.php | 128 +- .../Samples/TActiveMultiView/Home.php | 28 +- .../ActiveControls/Samples/TActivePanel/Home.php | 40 +- .../Samples/TActiveRadioButton/Home.php | 52 +- .../Samples/TActiveRadioButtonList/Home.php | 50 +- .../Samples/TActiveRepeater/Home.php | 156 +- .../Samples/TActiveTableRow/Home.php | 42 +- .../ActiveControls/Samples/TAutoComplete/Home.php | 68 +- .../Samples/TCallbackClientScript/Home.php | 56 +- .../Samples/TCallbackClientSide/Home.php | 22 +- .../Samples/TCallbackOptions/Home.php | 22 +- .../protected/pages/Advanced/Samples/I18N/Home.php | 88 +- .../pages/Advanced/Samples/I18N/LanguageList.php | 36 +- .../Controls/Samples/LabeledTextBox1/Home.php | 24 +- .../Samples/LabeledTextBox1/LabeledTextBox.php | 34 +- .../Controls/Samples/LabeledTextBox2/Home.php | 24 +- .../Samples/LabeledTextBox2/LabeledTextBox.php | 64 +- .../Controls/Samples/ResetValidation/Home.php | 14 +- .../pages/Controls/Samples/TAccordion/Home.php | 32 +- .../pages/Controls/Samples/TBulletedList/Home.php | 22 +- .../pages/Controls/Samples/TButton/Home.php | 26 +- .../pages/Controls/Samples/TCaptcha/Home.php | 52 +- .../pages/Controls/Samples/TCheckBox/Home.php | 20 +- .../pages/Controls/Samples/TCheckBoxList/Home.php | 138 +- .../Controls/Samples/TClientSideValidator/Home.php | 32 +- .../Controls/Samples/TCompareValidator/Home.php | 14 +- .../pages/Controls/Samples/TConditional/Home.php | 12 +- .../Controls/Samples/TCustomValidator/Home.php | 34 +- .../pages/Controls/Samples/TDataGrid/Sample1.php | 80 +- .../pages/Controls/Samples/TDataGrid/Sample2.php | 170 +- .../pages/Controls/Samples/TDataGrid/Sample3.php | 378 +- .../pages/Controls/Samples/TDataGrid/Sample4.php | 40 +- .../pages/Controls/Samples/TDataGrid/Sample5.php | 134 +- .../pages/Controls/Samples/TDataGrid/Sample6.php | 110 +- .../pages/Controls/Samples/TDataList/Sample1.php | 80 +- .../pages/Controls/Samples/TDataList/Sample2.php | 262 +- .../Controls/Samples/TDataTypeValidator/Home.php | 14 +- .../pages/Controls/Samples/TDropDownList/Home.php | 136 +- .../Samples/TEmailAddressValidator/Home.php | 14 +- .../pages/Controls/Samples/TFileUpload/Home.php | 40 +- .../pages/Controls/Samples/THtmlArea/Home.php | 40 +- .../pages/Controls/Samples/TImageButton/Home.php | 34 +- .../pages/Controls/Samples/TImageMap/Home.php | 20 +- .../pages/Controls/Samples/TKeyboard/Home.php | 20 +- .../pages/Controls/Samples/TLinkButton/Home.php | 26 +- .../pages/Controls/Samples/TListBox/Home.php | 156 +- .../pages/Controls/Samples/TMultiView/Home.php | 28 +- .../pages/Controls/Samples/TPager/Sample1.php | 162 +- .../pages/Controls/Samples/TPanel/Home.php | 20 +- .../pages/Controls/Samples/TPlaceHolder/Home.php | 30 +- .../pages/Controls/Samples/TRadioButton/Home.php | 52 +- .../Controls/Samples/TRadioButtonList/Home.php | 136 +- .../Controls/Samples/TRangeValidator/Home.php | 14 +- .../Samples/TRegularExpressionValidator/Home.php | 14 +- .../Controls/Samples/TRepeater/RegionDisplay.php | 54 +- .../pages/Controls/Samples/TRepeater/Sample1.php | 80 +- .../pages/Controls/Samples/TRepeater/Sample2.php | 156 +- .../pages/Controls/Samples/TRepeater/Sample3.php | 156 +- .../pages/Controls/Samples/TRepeater/Sample4.php | 72 +- .../pages/Controls/Samples/TRepeater/Sample5.php | 102 +- .../Samples/TRequiredFieldValidator/Home.php | 14 +- .../pages/Controls/Samples/TSlider/Home.php | 8 +- .../pages/Controls/Samples/TTabPanel/Home.php | 12 +- .../pages/Controls/Samples/TTable/Home.php | 64 +- .../pages/Controls/Samples/TTextBox/Home.php | 42 +- .../Controls/Samples/TValidationSummary/Home.php | 14 +- .../pages/Controls/Samples/TWizard/Sample1.php | 20 +- .../pages/Controls/Samples/TWizard/Sample2.php | 20 +- .../pages/Controls/Samples/TWizard/Sample3.php | 48 +- .../pages/Controls/Samples/TWizard/Sample4.php | 20 +- .../pages/Controls/Samples/TWizard/Sample5.php | 22 +- .../pages/Database/Samples/Scaffold/Home.php | 64 +- .../pages/Fundamentals/Samples/Hangman/Home.php | 240 +- demos/quickstart/protected/pages/Search.php | 110 +- demos/quickstart/protected/pages/ViewSource.php | 222 +- demos/sqlmap/index.php | 38 +- demos/sqlmap/protected/APP_CODE/Person.php | 50 +- demos/sqlmap/protected/pages/Manual/Layout.php | 12 +- demos/sqlmap/protected/pages/Manual/TopicList.php | 14 +- demos/sqlmap/protected/pages/Sample/crud1.php | 40 +- demos/sqlmap/protected/pages/Sample/crud2.php | 154 +- demos/time-tracker/index.php | 68 +- .../protected/App_Code/Dao/BaseDao.php | 88 +- .../protected/App_Code/Dao/CategoryDao.php | 104 +- .../protected/App_Code/Dao/CategoryRecord.php | 24 +- .../protected/App_Code/Dao/ProjectDao.php | 208 +- .../protected/App_Code/Dao/ProjectRecord.php | 68 +- .../protected/App_Code/Dao/ReportsDao.php | 172 +- .../protected/App_Code/Dao/TimeEntryDao.php | 74 +- .../protected/App_Code/Dao/TimeEntryRecord.php | 30 +- .../protected/App_Code/Dao/UserDao.php | 328 +- .../time-tracker/protected/App_Code/DaoManager.php | 156 +- .../protected/App_Code/TimeTrackerException.php | 64 +- .../protected/App_Code/TimeTrackerUser.php | 94 +- .../protected/App_Code/TrackerAuthManager.php | 168 +- .../protected/App_Code/UserManager.php | 178 +- .../protected/App_Data/DateTimeTypeHandler.php | 68 +- .../App_Data/TimeTrackerUserTypeHandler.php | 106 +- .../pages/TimeTracker/CategoryDataList.php | 186 +- .../protected/pages/TimeTracker/LogTimeEntry.php | 222 +- .../protected/pages/TimeTracker/Login.php | 108 +- .../protected/pages/TimeTracker/Logout.php | 66 +- .../protected/pages/TimeTracker/MainLayout.php | 12 +- .../protected/pages/TimeTracker/ProjectDetails.php | 380 +- .../protected/pages/TimeTracker/ProjectList.php | 66 +- .../protected/pages/TimeTracker/ReportProject.php | 104 +- .../protected/pages/TimeTracker/ReportResource.php | 140 +- .../protected/pages/TimeTracker/SiteMap.php | 112 +- .../protected/pages/TimeTracker/TimeEntryList.php | 176 +- .../protected/pages/TimeTracker/UserCreate.php | 222 +- .../protected/pages/TimeTracker/UserList.php | 66 +- demos/time-tracker/tests/functional.php | 18 +- .../tests/functional/HelloPradoTestCase.php | 26 +- demos/time-tracker/tests/unit.php | 20 +- demos/time-tracker/tests/unit/BaseTestCase.php | 126 +- .../tests/unit/CategoryDaoTestCase.php | 400 +- .../time-tracker/tests/unit/ProjectDaoTestCase.php | 398 +- .../tests/unit/TimeEntryDaoTestCase.php | 426 +- demos/time-tracker/tests/unit/UserDaoTestCase.php | 540 +-- framework/3rdParty/PhpShell/PHP/Shell.php | 2182 ++++----- framework/3rdParty/PhpShell/php-shell-init.php | 174 +- framework/3rdParty/SafeHtml/HTMLSax3.php | 1388 +++--- .../3rdParty/SafeHtml/HTMLSax3/Decorators.php | 724 +-- framework/3rdParty/SafeHtml/HTMLSax3/States.php | 574 +-- framework/3rdParty/SafeHtml/TSafeHtmlParser.php | 1344 +++--- .../3rdParty/TextHighlighter/Text/Highlighter.php | 792 ++-- .../TextHighlighter/Text/Highlighter/ABAP.php | 98 +- .../TextHighlighter/Text/Highlighter/CPP.php | 90 +- .../TextHighlighter/Text/Highlighter/CSS.php | 90 +- .../TextHighlighter/Text/Highlighter/DIFF.php | 90 +- .../TextHighlighter/Text/Highlighter/DTD.php | 90 +- .../TextHighlighter/Text/Highlighter/Generator.php | 2508 +++++----- .../TextHighlighter/Text/Highlighter/HTML.php | 98 +- .../TextHighlighter/Text/Highlighter/JAVA.php | 90 +- .../Text/Highlighter/JAVASCRIPT.php | 90 +- .../TextHighlighter/Text/Highlighter/MYSQL.php | 90 +- .../TextHighlighter/Text/Highlighter/PERL.php | 90 +- .../TextHighlighter/Text/Highlighter/PHP.php | 2176 ++++----- .../TextHighlighter/Text/Highlighter/PRADO.php | 506 +-- .../TextHighlighter/Text/Highlighter/PYTHON.php | 90 +- .../TextHighlighter/Text/Highlighter/RUBY.php | 90 +- .../TextHighlighter/Text/Highlighter/Renderer.php | 302 +- .../Text/Highlighter/Renderer/Array.php | 396 +- .../Text/Highlighter/Renderer/BB.php | 474 +- .../Text/Highlighter/Renderer/Console.php | 414 +- .../Text/Highlighter/Renderer/Html.php | 890 ++-- .../Text/Highlighter/Renderer/HtmlTags.php | 372 +- .../Text/Highlighter/Renderer/JSON.php | 170 +- .../Text/Highlighter/Renderer/XML.php | 204 +- .../TextHighlighter/Text/Highlighter/SQL.php | 90 +- .../TextHighlighter/Text/Highlighter/XML.php | 90 +- framework/Caching/TAPCCache.php | 266 +- framework/Caching/TCache.php | 1440 +++--- framework/Caching/TDbCache.php | 1156 ++--- framework/Caching/TSqliteCache.php | 448 +- framework/Caching/TXCache.php | 262 +- framework/Collections/TAttributeCollection.php | 342 +- framework/Collections/TDummyDataSource.php | 290 +- framework/Collections/TList.php | 972 ++-- framework/Collections/TListItemCollection.php | 328 +- framework/Collections/TMap.php | 704 +-- framework/Collections/TPagedDataSource.php | 890 ++-- framework/Collections/TPagedList.php | 952 ++-- framework/Collections/TPriorityList.php | 1486 +++--- framework/Collections/TQueue.php | 526 +-- framework/Collections/TStack.php | 524 +-- .../Exceptions/TActiveRecordException.php | 98 +- .../Relations/TActiveRecordBelongsTo.php | 274 +- .../Relations/TActiveRecordHasMany.php | 240 +- .../Relations/TActiveRecordHasManyAssociation.php | 750 +-- .../ActiveRecord/Relations/TActiveRecordHasOne.php | 288 +- .../Relations/TActiveRecordRelation.php | 508 +-- .../Relations/TActiveRecordRelationContext.php | 458 +- .../Data/ActiveRecord/Scaffold/TScaffoldBase.php | 414 +- .../ActiveRecord/Scaffold/TScaffoldEditView.php | 616 +-- .../ActiveRecord/Scaffold/TScaffoldListView.php | 608 +-- .../Data/ActiveRecord/Scaffold/TScaffoldSearch.php | 296 +- .../Data/ActiveRecord/Scaffold/TScaffoldView.php | 286 +- .../Data/ActiveRecord/TActiveRecordConfig.php | 400 +- .../Data/ActiveRecord/TActiveRecordCriteria.php | 72 +- .../Data/ActiveRecord/TActiveRecordManager.php | 324 +- .../Data/Common/Mssql/TMssqlCommandBuilder.php | 346 +- framework/Data/Common/Mssql/TMssqlTableColumn.php | 126 +- framework/Data/Common/Mssql/TMssqlTableInfo.php | 126 +- .../Data/Common/Mysql/TMysqlCommandBuilder.php | 50 +- framework/Data/Common/Mysql/TMysqlMetaData.php | 772 ++-- framework/Data/Common/Mysql/TMysqlTableColumn.php | 142 +- framework/Data/Common/Mysql/TMysqlTableInfo.php | 116 +- .../Data/Common/Pgsql/TPgsqlCommandBuilder.php | 136 +- framework/Data/Common/Pgsql/TPgsqlMetaData.php | 844 ++-- framework/Data/Common/Pgsql/TPgsqlTableColumn.php | 92 +- framework/Data/Common/Pgsql/TPgsqlTableInfo.php | 110 +- .../Data/Common/Sqlite/TSqliteCommandBuilder.php | 92 +- framework/Data/Common/Sqlite/TSqliteMetaData.php | 420 +- .../Data/Common/Sqlite/TSqliteTableColumn.php | 126 +- framework/Data/Common/Sqlite/TSqliteTableInfo.php | 92 +- framework/Data/Common/TDbCommandBuilder.php | 1014 ++--- framework/Data/Common/TDbMetaData.php | 364 +- framework/Data/Common/TDbTableColumn.php | 396 +- framework/Data/Common/TDbTableInfo.php | 310 +- framework/Data/DataGateway/TDataGatewayCommand.php | 1082 ++--- framework/Data/DataGateway/TSqlCriteria.php | 566 +-- framework/Data/DataGateway/TTableGateway.php | 948 ++-- .../Data/SqlMap/Configuration/TDiscriminator.php | 462 +- .../Configuration/TInlineParameterMapParser.php | 156 +- .../Data/SqlMap/Configuration/TParameterMap.php | 420 +- .../SqlMap/Configuration/TParameterProperty.php | 298 +- framework/Data/SqlMap/Configuration/TResultMap.php | 400 +- .../Data/SqlMap/Configuration/TResultProperty.php | 688 +-- .../SqlMap/Configuration/TSimpleDynamicParser.php | 88 +- .../SqlMap/Configuration/TSqlMapCacheModel.php | 492 +- .../Data/SqlMap/Configuration/TSqlMapStatement.php | 902 ++-- .../Configuration/TSqlMapXmlConfiguration.php | 1610 +++---- .../DataMapper/TFastSqlMapApplicationCache.php | 178 +- framework/Data/SqlMap/DataMapper/TLazyLoadList.php | 286 +- .../Data/SqlMap/DataMapper/TPropertyAccess.php | 312 +- framework/Data/SqlMap/DataMapper/TSqlMapCache.php | 590 +-- .../Data/SqlMap/DataMapper/TSqlMapException.php | 230 +- .../Data/SqlMap/DataMapper/TSqlMapPagedList.php | 416 +- .../DataMapper/TSqlMapTypeHandlerRegistry.php | 382 +- .../Data/SqlMap/Statements/IMappedStatement.php | 164 +- .../Data/SqlMap/Statements/TCachingStatement.php | 216 +- .../SqlMap/Statements/TDeleteMappedStatement.php | 46 +- .../SqlMap/Statements/TInsertMappedStatement.php | 96 +- .../Data/SqlMap/Statements/TMappedStatement.php | 2484 +++++----- .../Data/SqlMap/Statements/TPreparedCommand.php | 132 +- .../Data/SqlMap/Statements/TPreparedStatement.php | 112 +- .../Statements/TPreparedStatementFactory.php | 98 +- .../SqlMap/Statements/TSelectMappedStatement.php | 70 +- .../Data/SqlMap/Statements/TSimpleDynamicSql.php | 78 +- framework/Data/SqlMap/Statements/TStaticSql.php | 70 +- .../SqlMap/Statements/TUpdateMappedStatement.php | 96 +- framework/Data/SqlMap/TSqlMapConfig.php | 360 +- framework/Data/SqlMap/TSqlMapGateway.php | 516 +-- framework/Data/SqlMap/TSqlMapManager.php | 546 +-- framework/Data/TDataSourceConfig.php | 334 +- framework/Data/TDbCommand.php | 616 +-- framework/Data/TDbConnection.php | 1366 +++--- framework/Data/TDbDataReader.php | 448 +- framework/Data/TDbTransaction.php | 222 +- framework/Exceptions/TErrorHandler.php | 826 ++-- framework/Exceptions/TException.php | 832 ++-- framework/I18N/TChoiceFormat.php | 220 +- framework/I18N/TDateFormat.php | 506 +-- framework/I18N/TGlobalization.php | 598 +-- framework/I18N/TGlobalizationAutoDetect.php | 96 +- framework/I18N/TI18NControl.php | 180 +- framework/I18N/TNumberFormat.php | 502 +- framework/I18N/TTranslate.php | 510 +-- framework/I18N/TTranslateParameter.php | 236 +- framework/I18N/core/ChoiceFormat.php | 452 +- framework/I18N/core/CultureInfo.php | 1264 +++--- framework/I18N/core/DateFormat.php | 1304 +++--- framework/I18N/core/DateTimeFormatInfo.php | 1032 ++--- framework/I18N/core/Gettext/MO.php | 710 +-- framework/I18N/core/Gettext/PO.php | 320 +- framework/I18N/core/Gettext/TGettext.php | 572 +-- framework/I18N/core/HTTPNegotiator.php | 258 +- framework/I18N/core/IMessageSource.php | 244 +- framework/I18N/core/MessageCache.php | 342 +- framework/I18N/core/MessageFormat.php | 510 +-- framework/I18N/core/MessageSource.php | 672 +-- framework/I18N/core/MessageSource_Database.php | 646 +-- framework/I18N/core/MessageSource_MySQL.php | 836 ++-- framework/I18N/core/MessageSource_SQLite.php | 708 +-- framework/I18N/core/MessageSource_XLIFF.php | 1058 ++--- framework/I18N/core/MessageSource_gettext.php | 914 ++-- framework/I18N/core/NumberFormat.php | 612 +-- framework/I18N/core/NumberFormatInfo.php | 1300 +++--- framework/I18N/core/TCache_Lite.php | 1258 ++--- framework/I18N/core/util.php | 374 +- framework/IO/TTarFileExtractor.php | 1146 ++--- framework/IO/TTextWriter.php | 116 +- framework/Security/IUserManager.php | 114 +- framework/Security/TAuthManager.php | 914 ++-- framework/Security/TAuthorizationRule.php | 590 +-- framework/Security/TDbUserManager.php | 638 +-- framework/Security/TUser.php | 442 +- framework/Security/TUserManager.php | 802 ++-- framework/TApplicationComponent.php | 234 +- framework/TModule.php | 110 +- framework/TShellApplication.php | 96 +- framework/Util/TDataFieldAccessor.php | 164 +- framework/Util/TDateTimeStamp.php | 1406 +++--- framework/Util/TLogRouter.php | 2414 +++++----- framework/Util/TLogger.php | 472 +- framework/Util/TParameterModule.php | 346 +- framework/Util/TSimpleDateFormatter.php | 752 +-- framework/Util/TVarDumper.php | 254 +- framework/Web/Javascripts/JSMin.php | 580 +-- framework/Web/Javascripts/TJavaScript.php | 566 +-- framework/Web/Javascripts/packages.php | 242 +- .../source/prado/activecontrols/activecontrols3.js | 820 ++-- .../prado/activecontrols/activedatepicker.js | 174 +- .../source/prado/activecontrols/ajax3.js | 2288 +++++----- .../source/prado/activecontrols/dragdrop.js | 122 +- .../source/prado/activecontrols/inlineeditor.js | 602 +-- .../source/prado/colorpicker/colorpicker.js | 1560 +++---- .../Javascripts/source/prado/controls/controls.js | 1034 ++--- .../Javascripts/source/prado/controls/htmlarea.js | 298 +- .../Javascripts/source/prado/controls/keyboard.js | 322 +- .../Javascripts/source/prado/controls/tabpanel.js | 120 +- .../source/prado/datepicker/datepicker.js | 1578 +++---- .../Web/Javascripts/source/prado/logger/logger.js | 1506 +++--- framework/Web/Javascripts/source/prado/prado.js | 188 +- .../Javascripts/source/prado/ratings/ratings.js | 412 +- .../source/prado/scriptaculous-adapter.js | 2792 ++++++------ .../source/prado/validator/validation3.js | 3886 ++++++++-------- framework/Web/Services/TFeedService.php | 374 +- framework/Web/Services/TJsonService.php | 426 +- framework/Web/Services/TPageService.php | 1786 ++++---- framework/Web/TAssetManager.php | 714 +-- framework/Web/THttpResponse.php | 1438 +++--- framework/Web/THttpSession.php | 1460 +++--- framework/Web/THttpUtility.php | 124 +- framework/Web/TUrlManager.php | 280 +- framework/Web/TUrlMapping.php | 1768 ++++---- framework/Web/UI/ActiveControls/TActiveButton.php | 264 +- .../Web/UI/ActiveControls/TActiveClientScript.php | 164 +- .../UI/ActiveControls/TActiveControlAdapter.php | 1150 ++--- .../UI/ActiveControls/TActiveCustomValidator.php | 530 +-- framework/Web/UI/ActiveControls/TActiveLabel.php | 2 +- .../Web/UI/ActiveControls/TActivePageAdapter.php | 802 ++-- framework/Web/UI/ActiveControls/TActivePanel.php | 200 +- .../Web/UI/ActiveControls/TActiveRatingList.php | 266 +- framework/Web/UI/ActiveControls/TActiveTextBox.php | 250 +- framework/Web/UI/ActiveControls/TAutoComplete.php | 880 ++-- .../Web/UI/ActiveControls/TBaseActiveControl.php | 784 ++-- framework/Web/UI/ActiveControls/TCallback.php | 202 +- .../UI/ActiveControls/TCallbackClientScript.php | 1410 +++--- .../Web/UI/ActiveControls/TCallbackClientSide.php | 644 +-- .../UI/ActiveControls/TCallbackEventParameter.php | 174 +- .../Web/UI/ActiveControls/TCallbackOptions.php | 106 +- .../UI/ActiveControls/TEventTriggeredCallback.php | 190 +- .../Web/UI/ActiveControls/TInPlaceTextBox.php | 580 +-- .../Web/UI/ActiveControls/TTriggeredCallback.php | 142 +- .../UI/ActiveControls/TValueTriggeredCallback.php | 240 +- framework/Web/UI/TCachePageStatePersister.php | 400 +- framework/Web/UI/TCompositeControl.php | 74 +- framework/Web/UI/TControl.php | 4790 ++++++++++---------- framework/Web/UI/TControlAdapter.php | 286 +- framework/Web/UI/TForm.php | 342 +- framework/Web/UI/THtmlWriter.php | 458 +- framework/Web/UI/TPage.php | 2682 +++++------ framework/Web/UI/TPageStatePersister.php | 140 +- framework/Web/UI/TSessionPageStatePersister.php | 260 +- framework/Web/UI/TTemplateControl.php | 484 +- framework/Web/UI/TTemplateManager.php | 2150 ++++----- framework/Web/UI/TThemeManager.php | 1034 ++--- framework/Web/UI/WebControls/TAccordion.php | 1488 +++--- framework/Web/UI/WebControls/TBaseDataList.php | 378 +- framework/Web/UI/WebControls/TBoundColumn.php | 498 +- framework/Web/UI/WebControls/TBulletedList.php | 982 ++-- framework/Web/UI/WebControls/TButton.php | 734 +-- framework/Web/UI/WebControls/TButtonColumn.php | 554 +-- framework/Web/UI/WebControls/TCaptcha.php | 990 ++-- framework/Web/UI/WebControls/TCaptchaValidator.php | 254 +- framework/Web/UI/WebControls/TCheckBox.php | 1026 ++--- framework/Web/UI/WebControls/TCheckBoxColumn.php | 244 +- framework/Web/UI/WebControls/TCheckBoxList.php | 998 ++-- framework/Web/UI/WebControls/TColorPicker.php | 580 +-- framework/Web/UI/WebControls/TCompareValidator.php | 528 +-- framework/Web/UI/WebControls/TConditional.php | 284 +- framework/Web/UI/WebControls/TContent.php | 92 +- .../Web/UI/WebControls/TContentPlaceHolder.php | 94 +- framework/Web/UI/WebControls/TCustomValidator.php | 414 +- framework/Web/UI/WebControls/TDataBoundControl.php | 1174 ++--- framework/Web/UI/WebControls/TDataGrid.php | 4516 +++++++++--------- framework/Web/UI/WebControls/TDataGridColumn.php | 1134 ++--- .../Web/UI/WebControls/TDataGridItemRenderer.php | 58 +- .../Web/UI/WebControls/TDataGridPagerStyle.php | 510 +-- framework/Web/UI/WebControls/TDataList.php | 3530 +++++++-------- .../Web/UI/WebControls/TDataListItemRenderer.php | 342 +- framework/Web/UI/WebControls/TDataRenderer.php | 102 +- .../Web/UI/WebControls/TDataSourceControl.php | 234 +- framework/Web/UI/WebControls/TDataSourceView.php | 410 +- .../Web/UI/WebControls/TDataTypeValidator.php | 280 +- framework/Web/UI/WebControls/TDatePicker.php | 1986 ++++---- framework/Web/UI/WebControls/TDropDownList.php | 308 +- .../Web/UI/WebControls/TDropDownListColumn.php | 640 +-- .../Web/UI/WebControls/TEditCommandColumn.php | 528 +-- .../Web/UI/WebControls/TEmailAddressValidator.php | 192 +- framework/Web/UI/WebControls/TExpression.php | 122 +- framework/Web/UI/WebControls/TFileUpload.php | 562 +-- framework/Web/UI/WebControls/TFlushOutput.php | 170 +- framework/Web/UI/WebControls/TFont.php | 634 +-- framework/Web/UI/WebControls/THead.php | 754 +-- framework/Web/UI/WebControls/THiddenField.php | 410 +- framework/Web/UI/WebControls/THtmlElement.php | 136 +- framework/Web/UI/WebControls/THyperLink.php | 454 +- framework/Web/UI/WebControls/THyperLinkColumn.php | 546 +-- framework/Web/UI/WebControls/TImage.php | 312 +- framework/Web/UI/WebControls/TImageButton.php | 882 ++-- framework/Web/UI/WebControls/TImageMap.php | 1672 +++---- framework/Web/UI/WebControls/TItemDataRenderer.php | 164 +- framework/Web/UI/WebControls/TJavascriptLogger.php | 186 +- framework/Web/UI/WebControls/TKeyboard.php | 378 +- framework/Web/UI/WebControls/TLabel.php | 306 +- framework/Web/UI/WebControls/TLinkButton.php | 666 +-- framework/Web/UI/WebControls/TListBox.php | 486 +- framework/Web/UI/WebControls/TListControl.php | 1846 ++++---- .../Web/UI/WebControls/TListControlValidator.php | 448 +- framework/Web/UI/WebControls/TListItem.php | 366 +- framework/Web/UI/WebControls/TLiteral.php | 222 +- framework/Web/UI/WebControls/TLiteralColumn.php | 306 +- framework/Web/UI/WebControls/TMarkdown.php | 148 +- framework/Web/UI/WebControls/TMultiView.php | 756 +-- framework/Web/UI/WebControls/TOutputCache.php | 1240 ++--- framework/Web/UI/WebControls/TPager.php | 1582 +++---- framework/Web/UI/WebControls/TPanel.php | 492 +- framework/Web/UI/WebControls/TPanelStyle.php | 554 +-- framework/Web/UI/WebControls/TPlaceHolder.php | 54 +- framework/Web/UI/WebControls/TRadioButton.php | 638 +-- framework/Web/UI/WebControls/TRangeValidator.php | 716 +-- framework/Web/UI/WebControls/TRatingList.php | 718 +-- framework/Web/UI/WebControls/TReCaptcha.php | 464 +- .../Web/UI/WebControls/TReCaptchaValidator.php | 244 +- .../UI/WebControls/TRegularExpressionValidator.php | 288 +- framework/Web/UI/WebControls/TRepeatInfo.php | 1118 ++--- framework/Web/UI/WebControls/TRepeater.php | 2048 ++++----- .../Web/UI/WebControls/TRepeaterItemRenderer.php | 98 +- .../Web/UI/WebControls/TRequiredFieldValidator.php | 274 +- framework/Web/UI/WebControls/TSafeHtml.php | 170 +- framework/Web/UI/WebControls/TSlider.php | 1148 ++--- framework/Web/UI/WebControls/TStatements.php | 124 +- framework/Web/UI/WebControls/TStyle.php | 1786 ++++---- framework/Web/UI/WebControls/TTable.php | 818 ++-- framework/Web/UI/WebControls/TTableCell.php | 442 +- framework/Web/UI/WebControls/TTableFooterRow.php | 92 +- framework/Web/UI/WebControls/TTableHeaderCell.php | 246 +- framework/Web/UI/WebControls/TTableHeaderRow.php | 92 +- framework/Web/UI/WebControls/TTableRow.php | 414 +- framework/Web/UI/WebControls/TTemplateColumn.php | 510 +-- framework/Web/UI/WebControls/TTextBox.php | 1304 +++--- framework/Web/UI/WebControls/TTextProcessor.php | 170 +- .../Web/UI/WebControls/TValidationSummary.php | 1072 ++--- .../Web/UI/WebControls/TWebControlAdapter.php | 140 +- framework/Web/UI/WebControls/TWizard.php | 4290 +++++++++--------- .../WebControls/TWizardNavigationButtonStyle.php | 308 +- framework/Web/UI/WebControls/assets/captcha.php | 448 +- framework/interfaces.php | 760 ++-- framework/prado.php | 132 +- requirements/index.php | 568 +-- .../protected/pages/ActiveControlExpressionTag.php | 50 +- .../protected/pages/ActiveControlWithTinyMce.php | 20 +- .../protected/pages/ActiveImageButtonTest.php | 60 +- .../protected/pages/ActiveLinkButtonTest.php | 30 +- .../protected/pages/ActiveListBoxMasterTest.php | 92 +- .../protected/pages/ActiveListBoxTest.php | 92 +- .../protected/pages/ActivePanelVisibleTest.php | 34 +- .../protected/pages/ActiveRadioButtonListTest.php | 54 +- .../protected/pages/ActiveRadioButtonTest.php | 66 +- .../pages/ActiveRatingListAllowInputTest.php | 52 +- .../pages/ActiveRatingListAutoPostBackTest.php | 52 +- .../pages/ActiveRatingListCheckBoxesTest.php | 44 +- .../pages/ActiveRatingListEnabledTest.php | 72 +- .../pages/ActiveRatingListHoverCaptionTest.php | 52 +- .../protected/pages/ActiveRatingListRatingTest.php | 62 +- .../pages/ActiveRatingListReadOnlyTest.php | 74 +- .../pages/ActiveRatingListSelectedIndexTest.php | 62 +- .../protected/pages/ActiveRedirectionTest.php | 22 +- .../active-controls/protected/pages/Callback.php | 24 +- .../pages/CallbackCustomValidatorTest.php | 20 +- .../protected/pages/ClientSideDispatch.php | 32 +- .../protected/pages/CustomTemplateComponent.php | 20 +- .../protected/pages/CustomTemplateControlTest.php | 52 +- .../protected/pages/CustomValidatorByPass.php | 72 +- .../protected/pages/DMessagesPanel.php | 124 +- .../protected/pages/DatePickerInCallback.php | 32 +- .../protected/pages/DelayedCallback.php | 40 +- .../protected/pages/DisplayStyleTest.php | 50 +- .../protected/pages/DynamicRepeaterDataTest.php | 44 +- .../protected/pages/EventTriggeredCallback.php | 40 +- .../active-controls/protected/pages/GerTurno2.php | 104 +- .../active-controls/protected/pages/Home.php | 20 +- .../protected/pages/InPlaceWithValidator.php | 24 +- .../protected/pages/LargePageStateTest.php | 42 +- .../protected/pages/LargePageStateTest2.php | 42 +- .../active-controls/protected/pages/Master1.php | 12 +- .../protected/pages/MessagesPanelTest.php | 30 +- .../active-controls/protected/pages/MyControl.php | 14 +- .../protected/pages/MyTabPanelTest.php | 82 +- .../protected/pages/NullStateTest.php | 16 +- .../protected/pages/PopulateActiveList.php | 66 +- .../protected/pages/PostLoadingTest.php | 88 +- .../protected/pages/RadioButtonListTest.php | 54 +- .../active-controls/protected/pages/RatingList.php | 66 +- .../protected/pages/RepeaterWithActiveControls.php | 120 +- .../protected/pages/ReplaceContentTest.php | 82 +- .../protected/pages/Sessioned/PageStateTest.php | 24 +- .../protected/pages/TInPlaceTextBoxTest.php | 50 +- .../protected/pages/TestMasterPage.php | 12 +- .../protected/pages/TextBoxValidationCallback.php | 20 +- .../protected/pages/ValueTriggerCallbackTest.php | 22 +- .../tests/ActiveControlExpressTagTestCase.php | 38 +- .../tests/ActiveImageButtonTestCase.php | 32 +- .../tests/ActiveLinkButtonTestCase.php | 30 +- .../tests/ActiveListBoxMasterTestCase.php | 96 +- .../tests/ActiveListBoxTestCase.php | 92 +- .../tests/ActiveRadioButtonListTestCase.php | 98 +- .../tests/ActiveRadioButtonTestCase.php | 112 +- .../tests/CustomTemplateTestCase.php | 42 +- .../tests/DelayedCallbackTestCase.php | 42 +- .../active-controls/tests/EventTriggerTestCase.php | 42 +- .../active-controls/tests/PopulateListTestCase.php | 48 +- .../active-controls/tests/PostLoadingTestCase.php | 42 +- .../tests/ReplaceContentTestCase.php | 188 +- .../tests/TextBoxGroupValidationTestCase.php | 46 +- .../tests/ValueTriggerCallbackTestCase.php | 42 +- .../ActiveRatingListTestCase.php | 504 +- .../features/protected/controls/LabeledTextbox.php | 50 +- .../features/protected/controls/Layout.php | 14 +- .../pages/ActiveControls/ActiveControl.php | 86 +- .../pages/ActiveControls/AutoComplete.php | 66 +- .../protected/pages/ActiveControls/Calculator.php | 28 +- .../protected/pages/ActiveControls/Calculator2.php | 38 +- .../pages/ActiveControls/VisibleUpdate.php | 70 +- .../features/protected/pages/FeatureList.php | 66 +- .../features/protected/pages/FocusControl.php | 32 +- .../features/protected/pages/I18N/BasicI18N.php | 88 +- .../features/protected/pages/MyJavascriptLib.php | 62 +- .../features/protected/pages/TestComp.php | 38 +- .../protected/pages/myscripts/packages.php | 18 +- .../FunctionalTests/features/tests/MyTestCase.php | 36 +- .../ActiveControls/ActiveButtonTestCase.php | 74 +- .../ActiveControls/ActiveCheckBoxTestCase.php | 114 +- .../ActiveCustomValidatorTestCase.php | 66 +- tests/FunctionalTests/quickstart/Advanced/I18N.php | 106 +- .../quickstart/Controls/BulletedListTestCase.php | 74 +- .../quickstart/Controls/ButtonTestCase.php | 68 +- .../quickstart/Controls/CheckBoxListTestCase.php | 106 +- .../quickstart/Controls/CheckBoxTestCase.php | 108 +- .../quickstart/Controls/DataGrid1TestCase.php | 60 +- .../quickstart/Controls/DataGrid2TestCase.php | 100 +- .../quickstart/Controls/DataGrid3TestCase.php | 102 +- .../quickstart/Controls/DataGrid4TestCase.php | 58 +- .../quickstart/Controls/DataGrid5TestCase.php | 228 +- .../quickstart/Controls/DataGrid6TestCase.php | 98 +- .../quickstart/Controls/DataList1TestCase.php | 50 +- .../quickstart/Controls/DataList2TestCase.php | 120 +- .../quickstart/Controls/DropDownListTestCase.php | 132 +- .../quickstart/Controls/ExpressionTestCase.php | 28 +- .../quickstart/Controls/HtmlAreaTestCase.php | 28 +- .../quickstart/Controls/HyperLinkTestCase.php | 32 +- .../quickstart/Controls/ImageButtonTestCase.php | 58 +- .../quickstart/Controls/ImageTestCase.php | 38 +- .../quickstart/Controls/LabelTestCase.php | 44 +- .../quickstart/Controls/LinkButtonTestCase.php | 66 +- .../quickstart/Controls/ListBoxTestCase.php | 166 +- .../quickstart/Controls/MultiViewTestCase.php | 76 +- .../quickstart/Controls/PagerTestCase.php | 114 +- .../quickstart/Controls/PanelTestCase.php | 34 +- .../Controls/RadioButtonListTestCase.php | 106 +- .../quickstart/Controls/RadioButtonTestCase.php | 114 +- .../quickstart/Controls/Repeater1TestCase.php | 56 +- .../quickstart/Controls/Repeater2TestCase.php | 72 +- .../quickstart/Controls/Repeater3TestCase.php | 72 +- .../quickstart/Controls/StatementsTestCase.php | 28 +- .../quickstart/Controls/TabPanelTestCase.php | 96 +- .../quickstart/Controls/TableTestCase.php | 38 +- .../quickstart/Controls/TextBoxTestCase.php | 184 +- .../quickstart/Controls/Wizard1TestCase.php | 50 +- .../quickstart/Controls/Wizard2TestCase.php | 50 +- .../quickstart/Controls/Wizard3TestCase.php | 90 +- .../quickstart/Controls/Wizard4TestCase.php | 86 +- .../quickstart/Controls/Wizard5TestCase.php | 72 +- .../quickstart/Fundamentals/HangmanTestCase.php | 66 +- .../protected/pages/DActiveDropDownList2.php | 66 +- .../tickets/protected/pages/Issue120.php | 42 +- .../tickets/protected/pages/Issue216.php | 26 +- .../tickets/protected/pages/Layout.php | 44 +- .../tickets/protected/pages/Ticket121.php | 20 +- .../tickets/protected/pages/Ticket191.php | 42 +- .../tickets/protected/pages/Ticket21.php | 42 +- .../tickets/protected/pages/Ticket239.php | 30 +- .../tickets/protected/pages/Ticket278.php | 44 +- .../tickets/protected/pages/Ticket283.php | 20 +- .../tickets/protected/pages/Ticket284.php | 20 +- .../tickets/protected/pages/Ticket284Component.php | 206 +- .../tickets/protected/pages/Ticket359.php | 20 +- .../tickets/protected/pages/Ticket384.php | 86 +- .../tickets/protected/pages/Ticket413.php | 60 +- .../tickets/protected/pages/Ticket422.php | 210 +- .../tickets/protected/pages/Ticket433.php | 42 +- .../tickets/protected/pages/Ticket439.php | 24 +- .../tickets/protected/pages/Ticket470.php | 46 +- .../tickets/protected/pages/Ticket477.php | 26 +- .../tickets/protected/pages/Ticket484.php | 58 +- .../tickets/protected/pages/Ticket488.php | 24 +- .../tickets/protected/pages/Ticket500.php | 24 +- .../tickets/protected/pages/Ticket504.php | 48 +- .../tickets/protected/pages/Ticket507.php | 48 +- .../tickets/protected/pages/Ticket521.php | 30 +- .../tickets/protected/pages/Ticket526.php | 28 +- .../tickets/protected/pages/Ticket528.php | 68 +- .../tickets/protected/pages/Ticket535.php | 30 +- .../tickets/protected/pages/Ticket538.php | 202 +- .../tickets/protected/pages/Ticket542.php | 44 +- .../tickets/protected/pages/Ticket54Master.php | 12 +- .../tickets/protected/pages/Ticket578.php | 24 +- .../tickets/protected/pages/Ticket585.php | 34 +- .../tickets/protected/pages/Ticket586.php | 20 +- .../tickets/protected/pages/Ticket587.php | 22 +- .../tickets/protected/pages/Ticket587_reopened.php | 122 +- .../tickets/protected/pages/Ticket591.php | 16 +- .../tickets/protected/pages/Ticket598.php | 36 +- .../tickets/protected/pages/Ticket603.php | 58 +- .../tickets/protected/pages/Ticket660.php | 10 +- .../protected/pages/Ticket703/Ticket703.php | 60 +- .../tickets/protected/pages/Ticket708.php | 58 +- .../tickets/protected/pages/Ticket72.php | 24 +- .../tickets/protected/pages/Ticket93.php | 28 +- .../tickets/protected700/common/BasePage.php | 134 +- .../tickets/protected700/layout/MainLayout.php | 22 +- .../tickets/protected700/pages/UserLogin.php | 24 +- .../tickets/tests/Issue120TestCase.php | 40 +- .../tickets/tests/Issue216TestCase.php | 54 +- .../tickets/tests/Ticket121TestCase.php | 36 +- .../tickets/tests/Ticket191TestCase.php | 30 +- .../tickets/tests/Ticket21TestCase.php | 36 +- .../tickets/tests/Ticket239TestCase.php | 108 +- .../tickets/tests/Ticket274TestCase.php | 46 +- .../tickets/tests/Ticket278TestCase.php | 112 +- .../tickets/tests/Ticket27TestCase.php | 34 +- .../tickets/tests/Ticket284TestCase.php | 26 +- .../tickets/tests/Ticket285TestCase.php | 22 +- .../tickets/tests/Ticket433TestCase.php | 30 +- .../tickets/tests/Ticket439TestCase.php | 30 +- .../tickets/tests/Ticket463TestCase.php | 24 +- .../tickets/tests/Ticket470TestCase.php | 100 +- .../tickets/tests/Ticket477TestCase.php | 42 +- .../tickets/tests/Ticket488TestCase.php | 82 +- .../tickets/tests/Ticket504TestCase.php | 104 +- .../tickets/tests/Ticket507TestCase.php | 52 +- .../tickets/tests/Ticket521TestCase.php | 38 +- .../tickets/tests/Ticket526TestCase.php | 34 +- .../tickets/tests/Ticket528TestCase.php | 62 +- .../tickets/tests/Ticket535TestCase.php | 70 +- .../tickets/tests/Ticket538TestCase.php | 58 +- .../tickets/tests/Ticket54TestCase.php | 22 +- .../tickets/tests/Ticket573TestCase.php | 26 +- .../tickets/tests/Ticket578TestCase.php | 56 +- .../tickets/tests/Ticket585TestCase.php | 52 +- .../tickets/tests/Ticket586TestCase.php | 40 +- .../tickets/tests/Ticket587TestCase.php | 92 +- .../tickets/tests/Ticket653TestCase.php | 28 +- .../tickets/tests/Ticket659TestCase.php | 44 +- .../tickets/tests/Ticket700TestCase.php | 142 +- .../tickets/tests/Ticket703TestCase.php | 40 +- .../tickets/tests/Ticket708TestCase.php | 54 +- .../tickets/tests/Ticket72TestCase.php | 30 +- .../tickets/tests/Ticket93TestCase.php | 32 +- .../validators/protected/pages/Button.php | 52 +- .../validators/protected/pages/CheckBox.php | 52 +- .../protected/pages/ConditionalValidation.php | 40 +- .../validators/protected/pages/CustomValidator.php | 28 +- .../validators/protected/pages/ImageButton.php | 52 +- .../validators/protected/pages/Layout.php | 12 +- .../validators/protected/pages/LinkButton.php | 52 +- .../validators/tests/ButtonTestCase.php | 128 +- .../validators/tests/CheckBoxTestCase.php | 138 +- .../validators/tests/CompareValidatorTestCase.php | 90 +- .../tests/ConditionalValidationTestCase.php | 110 +- .../validators/tests/CustomValidatorTestCase.php | 60 +- .../validators/tests/DataTypeValidatorTestCase.php | 98 +- .../validators/tests/DatePickerTestCase.php | 144 +- .../validators/tests/ImageButtonTestCase.php | 128 +- .../validators/tests/LinkButtonTestCase.php | 126 +- .../validators/tests/ListControlTestCase.php | 102 +- .../validators/tests/RangeValidatorTestCase.php | 334 +- .../validators/tests/RegExpValidatorTestCase.php | 66 +- .../validators/tests/RequiredFieldTestCase.php | 178 +- .../validators/tests/RequiredListTestCase.php | 84 +- .../validators/tests/ValidationSummaryTestCase.php | 98 +- .../ActiveRecordDynamicCallTestCase.php | 134 +- .../ActiveRecord/ActiveRecordFinderTestCase.php | 84 +- .../ActiveRecord/ActiveRecordMySql5TestCase.php | 88 +- .../ActiveRecord/ActiveRecordRegistryTestCase.php | 330 +- .../ActiveRecord/BaseActiveRecordTestCase.php | 62 +- .../ActiveRecord/CountRecordsTestCase.php | 64 +- .../simple_unit/ActiveRecord/CriteriaTestCase.php | 98 +- .../ActiveRecord/DeleteByPkTestCase.php | 56 +- .../simple_unit/ActiveRecord/FindByPksTestCase.php | 124 +- .../simple_unit/ActiveRecord/FindBySqlTestCase.php | 88 +- .../ActiveRecord/ForeignKeyTestCase.php | 348 +- .../ActiveRecord/ForeignObjectUpdateTest.php | 482 +- .../ActiveRecord/MultipleForeignKeyTestCase.php | 382 +- .../ActiveRecord/RecordEventTestCase.php | 72 +- tests/simple_unit/ActiveRecord/SqliteTestCase.php | 38 +- .../ActiveRecord/UserRecordTestCase.php | 130 +- .../ActiveRecord/ViewRecordTestCase.php | 146 +- tests/simple_unit/ActiveRecord/records/Blogs.php | 24 +- .../ActiveRecord/records/DepSections.php | 28 +- .../ActiveRecord/records/DepartmentRecord.php | 32 +- .../ActiveRecord/records/ItemRecord.php | 96 +- .../ActiveRecord/records/SimpleUser.php | 24 +- .../ActiveRecord/records/SqliteUsers.php | 28 +- .../ActiveRecord/records/UserRecord.php | 72 +- .../DbCommon/CommandBuilderMssqlTest.php | 86 +- .../DbCommon/CommandBuilderMysqlTest.php | 32 +- .../DbCommon/CommandBuilderPgsqlTest.php | 148 +- tests/simple_unit/DbCommon/MssqlColumnTest.php | 90 +- tests/simple_unit/DbCommon/Mysql4ColumnTest.php | 504 +- tests/simple_unit/DbCommon/MysqlColumnTest.php | 504 +- tests/simple_unit/DbCommon/PgsqlColumnTest.php | 272 +- tests/simple_unit/DbCommon/SqliteColumnTest.php | 54 +- tests/simple_unit/I18N/ChoiceFormatTest.php | 194 +- tests/simple_unit/I18N/CultureInfoTest.php | 24 +- .../I18N/MysqlMessageSourceTestCase.php | 88 +- tests/simple_unit/Soap/ContactManager.php | 312 +- tests/simple_unit/Soap/SoapTestCase.php | 182 +- .../simple_unit/SqlMap/ActiveRecordSqlMapTest.php | 172 +- tests/simple_unit/SqlMap/BaseCase.php | 522 +-- tests/simple_unit/SqlMap/CacheTest.php | 326 +- tests/simple_unit/SqlMap/DelegateTest.php | 126 +- tests/simple_unit/SqlMap/Dynamic/DynamicTest.php | 20 +- tests/simple_unit/SqlMap/GroupByTest.php | 84 +- tests/simple_unit/SqlMap/InheritanceTest.php | 288 +- tests/simple_unit/SqlMap/ParameterMapTest.php | 496 +- tests/simple_unit/SqlMap/PropertyAccessTest.php | 152 +- tests/simple_unit/SqlMap/ResultClassTest.php | 496 +- tests/simple_unit/SqlMap/ResultMapTest.php | 544 +-- tests/simple_unit/SqlMap/SelectKeyTest.php | 238 +- tests/simple_unit/SqlMap/SqlMapCacheTest.php | 152 +- tests/simple_unit/SqlMap/StatementExtendsTest.php | 56 +- tests/simple_unit/SqlMap/StatementTest.php | 2268 ++++----- tests/simple_unit/SqlMap/TestQueryForMap.php | 84 +- tests/simple_unit/SqlMap/common.php | 308 +- tests/simple_unit/SqlMap/domain/A.php | 52 +- tests/simple_unit/SqlMap/domain/Account.php | 70 +- tests/simple_unit/SqlMap/domain/AccountBis.php | 24 +- .../SqlMap/domain/AccountCollection.php | 32 +- tests/simple_unit/SqlMap/domain/B.php | 44 +- tests/simple_unit/SqlMap/domain/Book.php | 20 +- tests/simple_unit/SqlMap/domain/C.php | 28 +- tests/simple_unit/SqlMap/domain/Category.php | 36 +- tests/simple_unit/SqlMap/domain/Complex.php | 20 +- tests/simple_unit/SqlMap/domain/D.php | 30 +- tests/simple_unit/SqlMap/domain/Document.php | 30 +- .../SqlMap/domain/DocumentCollection.php | 14 +- tests/simple_unit/SqlMap/domain/E.php | 30 +- tests/simple_unit/SqlMap/domain/F.php | 30 +- tests/simple_unit/SqlMap/domain/LineItem.php | 62 +- .../SqlMap/domain/LineItemCollection.php | 14 +- tests/simple_unit/SqlMap/domain/Newspaper.php | 22 +- tests/simple_unit/SqlMap/domain/Order.php | 140 +- tests/simple_unit/SqlMap/domain/Other.php | 44 +- tests/simple_unit/SqlMap/domain/Sample.php | 108 +- tests/simple_unit/SqlMap/domain/Search.php | 44 +- tests/simple_unit/SqlMap/domain/User.php | 52 +- tests/simple_unit/SqlMap/gen.php | 64 +- tests/simple_unit/SqlMap/queryForListLimitTest.php | 78 +- tests/simple_unit/TableGateway/BaseGatewayTest.php | 182 +- tests/simple_unit/TableGateway/CountTest.php | 26 +- tests/simple_unit/TableGateway/DeleteByPkTest.php | 98 +- tests/simple_unit/TableGateway/MagicCallTest.php | 56 +- .../TableGateway/TableGatewayPgsqlTest.php | 106 +- .../TableGateway/TableInfoGatewayTest.php | 28 +- tests/simple_unit/TableGateway/TestFindByPk.php | 90 +- tests/simple_unit/Tickets/Ticket589Test.php | 42 +- tests/simple_unit/unit.php | 16 +- tests/simple_unit/ws.php | 16 +- .../selenium/core/lib/cssQuery/cssQuery-p.js | 12 +- .../core/lib/cssQuery/src/cssQuery-level2.js | 284 +- .../core/lib/cssQuery/src/cssQuery-level3.js | 300 +- .../core/lib/cssQuery/src/cssQuery-standard.js | 106 +- .../selenium/core/lib/cssQuery/src/cssQuery.js | 712 +-- tests/test_tools/selenium/core/scripts/js2html.js | 140 +- tests/test_tools/selenium/core/scripts/se2html.js | 126 +- tests/test_tools/selenium/php/TestSuiteHeader.php | 108 +- tests/unit/Data/SqlMap/AllTests.php | 60 +- tests/unit/Data/SqlMap/DynamicParameterTest.php | 216 +- tests/unit/Data/TDbDataReaderTest.php | 356 +- tests/unit/SQLMap/BaseTest.php | 518 +-- tests/unit/SQLMap/CacheTest.php | 326 +- tests/unit/SQLMap/ConfigureTest.php | 38 +- tests/unit/SQLMap/ConnectionTest.php | 50 +- tests/unit/SQLMap/DelegateTest.php | 126 +- tests/unit/SQLMap/GroupByTest.php | 84 +- tests/unit/SQLMap/InheritanceTest.php | 290 +- tests/unit/SQLMap/ParameterMapTest.php | 496 +- tests/unit/SQLMap/PropertyAccessTest.php | 152 +- tests/unit/SQLMap/ResultClassTest.php | 562 +-- tests/unit/SQLMap/ResultMapTest.php | 558 +-- tests/unit/SQLMap/SelectKeyTest.php | 238 +- tests/unit/SQLMap/SqlMapCacheTest.php | 152 +- tests/unit/SQLMap/StatementTest.php | 2266 ++++----- tests/unit/SQLMap/TAdodbConnectionTestCase.php | 126 +- tests/unit/SQLMap/common.php | 302 +- tests/unit/SQLMap/domain/A.php | 52 +- tests/unit/SQLMap/domain/Account.php | 70 +- tests/unit/SQLMap/domain/AccountBis.php | 24 +- tests/unit/SQLMap/domain/AccountCollection.php | 32 +- tests/unit/SQLMap/domain/B.php | 44 +- tests/unit/SQLMap/domain/Book.php | 20 +- tests/unit/SQLMap/domain/C.php | 28 +- tests/unit/SQLMap/domain/Category.php | 36 +- tests/unit/SQLMap/domain/Complex.php | 20 +- tests/unit/SQLMap/domain/D.php | 30 +- tests/unit/SQLMap/domain/Document.php | 30 +- tests/unit/SQLMap/domain/DocumentCollection.php | 14 +- tests/unit/SQLMap/domain/E.php | 30 +- tests/unit/SQLMap/domain/F.php | 30 +- tests/unit/SQLMap/domain/LineItem.php | 62 +- tests/unit/SQLMap/domain/LineItemCollection.php | 14 +- tests/unit/SQLMap/domain/Newspaper.php | 22 +- tests/unit/SQLMap/domain/Order.php | 140 +- tests/unit/SQLMap/domain/Other.php | 44 +- tests/unit/SQLMap/domain/Sample.php | 108 +- tests/unit/SQLMap/domain/Search.php | 44 +- tests/unit/SQLMap/domain/User.php | 52 +- tests/unit/Util/TDateTimeStampTest.php | 298 +- 1053 files changed, 147935 insertions(+), 148897 deletions(-) diff --git a/.gitattributes b/.gitattributes index 44c7afe4..71a3e173 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,55 +4,10 @@ /UPGRADE -text /build.xml -text buildscripts/.htaccess -text -buildscripts/Benchmark/Iterate.php -text buildscripts/Benchmark/LICENSE -text -buildscripts/Benchmark/Profiler.php -text -buildscripts/Benchmark/Timer.php -text -buildscripts/Benchmark/doc/timer_example.php -text -buildscripts/PHPUnit2/Extensions/ExceptionTestCase.php -text -buildscripts/PHPUnit2/Extensions/PerformanceTestCase.php -text -buildscripts/PHPUnit2/Extensions/RepeatedTest.php -text -buildscripts/PHPUnit2/Extensions/TestDecorator.php -text -buildscripts/PHPUnit2/Extensions/TestSetup.php -text -buildscripts/PHPUnit2/Framework/Assert.php -text -buildscripts/PHPUnit2/Framework/AssertionFailedError.php -text -buildscripts/PHPUnit2/Framework/ComparisonFailure.php -text -buildscripts/PHPUnit2/Framework/Error.php -text -buildscripts/PHPUnit2/Framework/IncompleteTest.php -text -buildscripts/PHPUnit2/Framework/IncompleteTestError.php -text -buildscripts/PHPUnit2/Framework/Test.php -text -buildscripts/PHPUnit2/Framework/TestCase.php -text -buildscripts/PHPUnit2/Framework/TestFailure.php -text -buildscripts/PHPUnit2/Framework/TestListener.php -text -buildscripts/PHPUnit2/Framework/TestResult.php -text -buildscripts/PHPUnit2/Framework/TestSuite.php -text -buildscripts/PHPUnit2/Framework/Warning.php -text -buildscripts/PHPUnit2/Runner/BaseTestRunner.php -text -buildscripts/PHPUnit2/Runner/IncludePathTestCollector.php -text -buildscripts/PHPUnit2/Runner/StandardTestSuiteLoader.php -text -buildscripts/PHPUnit2/Runner/TestCollector.php -text -buildscripts/PHPUnit2/Runner/TestSuiteLoader.php -text -buildscripts/PHPUnit2/Runner/Version.php -text -buildscripts/PHPUnit2/TextUI/ResultPrinter.php -text -buildscripts/PHPUnit2/TextUI/TestRunner.php -text -buildscripts/PHPUnit2/Util/CodeCoverage/Renderer.php -text -buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/HTML.php -text -buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/Text.php -text -buildscripts/PHPUnit2/Util/ErrorHandler.php -text -buildscripts/PHPUnit2/Util/Fileloader.php -text -buildscripts/PHPUnit2/Util/Filter.php -text -buildscripts/PHPUnit2/Util/Log/PEAR.php -text -buildscripts/PHPUnit2/Util/Log/XML.php -text -buildscripts/PHPUnit2/Util/Printer.php -text -buildscripts/PHPUnit2/Util/Skeleton.php -text -buildscripts/PHPUnit2/Util/TestDox/NamePrettifier.php -text -buildscripts/PHPUnit2/Util/TestDox/ResultPrinter.php -text -buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/HTML.php -text -buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/Text.php -text buildscripts/PHPUnit2/pear-phpunit -text buildscripts/PHPUnit2/pear-phpunit.bat -text buildscripts/PhpDocumentor/LICENSE -text -buildscripts/PhpDocumentor/new_phpdoc.php -text buildscripts/PhpDocumentor/pear-phpdoc -text buildscripts/PhpDocumentor/phpDocumentor.ini -text buildscripts/PhpDocumentor/phpDocumentor/Classes.inc -text @@ -287,7 +242,6 @@ buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/de buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/default/templates/media/images/empty.png -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/default/templates/media/images/minus.gif -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/default/templates/media/images/plus.gif -text -buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/default/templates/media/lib/classTree.js -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/default/templates/media/stylesheet.css -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/default/templates/method.tpl -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/default/templates/page.tpl -text @@ -371,7 +325,6 @@ buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/ea buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates/media/images/tutorial.png -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates/media/images/tutorial_folder.png -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates/media/images/up_button.png -text -buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates/media/lib/classTree.js -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates/media/stylesheet.css -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates/method.tpl -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates/page.tpl -text @@ -414,7 +367,6 @@ buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/l0 buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/l0l33t/templates/media/images/Tplus.png -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/l0l33t/templates/media/images/blank.png -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/l0l33t/templates/media/images/empty.png -text -buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/l0l33t/templates/media/lib/classTree.js -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/l0l33t/templates/media/minus.gif -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/l0l33t/templates/media/plus.gif -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/l0l33t/templates/media/stylesheet.css -text @@ -460,7 +412,6 @@ buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/ph buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phpdoc.de/templates/media/images/empty.png -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phpdoc.de/templates/media/images/minus.gif -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phpdoc.de/templates/media/images/plus.gif -text -buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phpdoc.de/templates/media/lib/classTree.js -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phpdoc.de/templates/media/stylesheet.css -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phpdoc.de/templates/method.tpl -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phpdoc.de/templates/page.tpl -text @@ -504,7 +455,6 @@ buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/ph buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phphtmllib/templates/media/images/empty.png -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phphtmllib/templates/media/images/minus.gif -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phphtmllib/templates/media/images/plus.gif -text -buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phphtmllib/templates/media/lib/classTree.js -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phphtmllib/templates/media/stylesheet.css -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phphtmllib/templates/method.tpl -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/phphtmllib/templates/page.tpl -text @@ -757,10 +707,7 @@ buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedi buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/media/images/openfoldericon.png -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/media/images/plus.gif -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/media/images/spacer.gif -text -buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/media/lib/classTree.js -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/media/lib/tab.webfx.css -text -buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/media/lib/tabpane.js -text -buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/media/lib/ua.js -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/media/stylesheet.css -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/method.tpl -text buildscripts/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phpedit/templates/page.tpl -text @@ -821,7 +768,6 @@ buildscripts/PhpDocumentor/phpDocumentor/ParserDocBlock.inc -text buildscripts/PhpDocumentor/phpDocumentor/ParserElements.inc -text buildscripts/PhpDocumentor/phpDocumentor/ProceduralPages.inc -text buildscripts/PhpDocumentor/phpDocumentor/Publisher.inc -text -buildscripts/PhpDocumentor/phpDocumentor/Setup.inc.php -text buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/BUGS -text buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/COPYING.lib -text buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/ChangeLog -text @@ -831,103 +777,20 @@ buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/NEWS -text buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/README -text buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/RELEASE_NOTES -text buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/TODO -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Config_File.class.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty.class.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.assemble_plugin_filepath.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.assign_smarty_interface.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.create_dir_structure.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.display_debug_console.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.get_include_path.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.get_microtime.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.get_php_resource.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.is_secure.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.is_trusted.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.load_plugins.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.load_resource_plugin.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.process_cached_inserts.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.process_compiled_include.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.read_cache_file.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.rm_auto.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.rmdir.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.run_insert_handler.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.smarty_include_php.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.write_cache_file.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.write_compiled_include.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.write_compiled_resource.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/core/core.write_file.php -text buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/debug.tpl -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/block.strip.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/block.textformat.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.assign.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.assign_debug_info.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.config_load.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.counter.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.cycle.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.debug.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.eval.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.fetch.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.html_checkboxes.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.html_image.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.html_options.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.html_radios.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.html_select_date.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.html_select_time.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.html_table.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.mailto.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.math.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.popup.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.popup_init.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/function.var_dump.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.capitalize.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.cat.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.count_characters.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.count_paragraphs.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.count_sentences.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.count_words.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.date_format.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.debug_print_var.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.default.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.escape.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.htmlentities.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.indent.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.lower.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.nl2br.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.rawurlencode.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.regex_replace.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.replace.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.spacify.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.string_format.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.strip.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.strip_tags.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.truncate.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.upper.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.wordwrap.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/outputfilter.trimwhitespace.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/shared.escape_special_chars.php -text -buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/shared.make_timestamp.php -text buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/misc/smarty_icon.README -text buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/misc/smarty_icon.gif -text buildscripts/PhpDocumentor/phpDocumentor/TutorialHighlightParser.inc -text buildscripts/PhpDocumentor/phpDocumentor/WordParser.inc -text buildscripts/PhpDocumentor/phpDocumentor/XMLpackagePageParser.inc -text -buildscripts/PhpDocumentor/phpDocumentor/clone.inc.php -text -buildscripts/PhpDocumentor/phpDocumentor/clone5.inc.php -text -buildscripts/PhpDocumentor/phpDocumentor/common.inc.php -text -buildscripts/PhpDocumentor/phpDocumentor/find_phpdoc.php -text buildscripts/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc -text buildscripts/PhpDocumentor/phpDocumentor/phpDocumentorTWordParser.inc -text buildscripts/PhpDocumentor/phpDocumentor/phpdoc.inc -text buildscripts/PhpDocumentor/phpdoc -text -buildscripts/PhpDocumentor/phpdoc.php -text buildscripts/PhpDocumentor/poweredbyphpdoc.gif -text buildscripts/PhpDocumentor/prado_patch_chm_builder_fix.patch -text buildscripts/PhpDocumentor/prado_patch_dot_in_package_name.patch -text -buildscripts/PhpDocumentor/scripts/add_cvs.php -text -buildscripts/PhpDocumentor/scripts/create_examples.php -text -buildscripts/PhpDocumentor/scripts/create_package.xml.php -text buildscripts/PhpDocumentor/scripts/makedoc.sh -text -buildscripts/PhpDocumentor/scripts/tokenizer_test.php -text buildscripts/PhpDocumentor/user/default.ini -text buildscripts/PhpDocumentor/user/demo.ini -text buildscripts/PhpDocumentor/user/error.ini -text @@ -935,26 +798,13 @@ buildscripts/PhpDocumentor/user/makedocs.ini -text buildscripts/PhpDocumentor/user/pear-makedocs.ini -text buildscripts/PhpDocumentor/user/prado.ini -text buildscripts/PhpDocumentor/user/testdocbook.ini -text -buildscripts/chmbuilder/ChmQuickstartBuilder.php -text -buildscripts/chmbuilder/build.php -text -buildscripts/chmbuilder/build_child.php -text buildscripts/chmbuilder/chm_style.css -text buildscripts/chmbuilder/classes/application.xml -text buildscripts/chmbuilder/classes/pages/ClassDoc.page -text -buildscripts/chmbuilder/classes/pages/ClassDoc.php -text buildscripts/chmbuilder/classes/pages/Classes.page -text -buildscripts/chmbuilder/classes/pages/Classes.php -text -buildscripts/chmbuilder/classes/pages/MainLayout.php -text buildscripts/chmbuilder/classes/pages/MainLayout.tpl -text buildscripts/chmbuilder/classes/pages/style.css -text -buildscripts/chmbuilder/index.php -text -buildscripts/classtree/DWExtension.php -text buildscripts/classtree/DWExtensionReadme.txt -text -buildscripts/classtree/build.php -text -buildscripts/index/api_index.php -text -buildscripts/index/build.php -text -buildscripts/index/quickstart_index.php -text -buildscripts/index/search.php -text buildscripts/jGrouseDoc/3rdparty/ant/LICENSE -text buildscripts/jGrouseDoc/3rdparty/ant/LICENSE.dom -text buildscripts/jGrouseDoc/3rdparty/ant/LICENSE.sax -text @@ -974,15 +824,10 @@ buildscripts/jGrouseDoc/skins/common/img/closedLarge.gif -text buildscripts/jGrouseDoc/skins/common/img/node.gif -text buildscripts/jGrouseDoc/skins/common/img/open.gif -text buildscripts/jGrouseDoc/skins/common/img/openLarge.gif -text -buildscripts/jGrouseDoc/skins/common/js/jgdoc.js -text -buildscripts/jGrouseDoc/skins/common/js/jgindex.js -text -buildscripts/jGrouseDoc/skins/common/js/navTree.js -text buildscripts/jGrouseDoc/skins/common/vm/common.vm -text buildscripts/jGrouseDoc/skins/common/xslt/common.xslt -text buildscripts/jGrouseDoc/skins/noframes/css/jgdoc.css -text buildscripts/jGrouseDoc/skins/noframes/img/logo.gif -text -buildscripts/jGrouseDoc/skins/noframes/js/jgdoc.js -text -buildscripts/jGrouseDoc/skins/noframes/js/navTree.js -text buildscripts/jGrouseDoc/skins/noframes/vm/antgen.vm -text buildscripts/jGrouseDoc/skins/noframes/vm/detail.vm -text buildscripts/jGrouseDoc/skins/noframes/vm/jsindex.vm -text @@ -1012,328 +857,54 @@ buildscripts/phing/bin/pear-phing -text buildscripts/phing/bin/pear-phing.bat -text buildscripts/phing/bin/phing -text buildscripts/phing/bin/phing.bat -text -buildscripts/phing/bin/phing.php -text -buildscripts/phing/classes/phing/BuildEvent.php -text -buildscripts/phing/classes/phing/BuildException.php -text -buildscripts/phing/classes/phing/BuildListener.php -text -buildscripts/phing/classes/phing/IntrospectionHelper.php -text -buildscripts/phing/classes/phing/Phing.php -text -buildscripts/phing/classes/phing/Project.php -text -buildscripts/phing/classes/phing/ProjectComponent.php -text -buildscripts/phing/classes/phing/RuntimeConfigurable.php -text -buildscripts/phing/classes/phing/Target.php -text -buildscripts/phing/classes/phing/Task.php -text -buildscripts/phing/classes/phing/TaskAdapter.php -text -buildscripts/phing/classes/phing/TaskContainer.php -text -buildscripts/phing/classes/phing/UnknownElement.php -text -buildscripts/phing/classes/phing/filters/BaseFilterReader.php -text -buildscripts/phing/classes/phing/filters/BaseParamFilterReader.php -text -buildscripts/phing/classes/phing/filters/ChainableReader.php -text -buildscripts/phing/classes/phing/filters/ExpandProperties.php -text -buildscripts/phing/classes/phing/filters/HeadFilter.php -text -buildscripts/phing/classes/phing/filters/LineContains.php -text -buildscripts/phing/classes/phing/filters/LineContainsRegexp.php -text -buildscripts/phing/classes/phing/filters/PrefixLines.php -text -buildscripts/phing/classes/phing/filters/ReplaceRegexp.php -text -buildscripts/phing/classes/phing/filters/ReplaceTokens.php -text -buildscripts/phing/classes/phing/filters/StripLineBreaks.php -text -buildscripts/phing/classes/phing/filters/StripLineComments.php -text -buildscripts/phing/classes/phing/filters/StripPhpComments.php -text -buildscripts/phing/classes/phing/filters/TabToSpaces.php -text -buildscripts/phing/classes/phing/filters/TailFilter.php -text -buildscripts/phing/classes/phing/filters/TidyFilter.php -text -buildscripts/phing/classes/phing/filters/TranslateGettext.php -text -buildscripts/phing/classes/phing/filters/XsltFilter.php -text -buildscripts/phing/classes/phing/filters/util/ChainReaderHelper.php -text -buildscripts/phing/classes/phing/filters/util/IniFileTokenReader.php -text -buildscripts/phing/classes/phing/input/DefaultInputHandler.php -text -buildscripts/phing/classes/phing/input/InputHandler.php -text -buildscripts/phing/classes/phing/input/InputRequest.php -text -buildscripts/phing/classes/phing/input/MultipleChoiceInputRequest.php -text -buildscripts/phing/classes/phing/input/PropertyFileInputHandler.php -text -buildscripts/phing/classes/phing/input/YesNoInputRequest.php -text -buildscripts/phing/classes/phing/lib/Capsule.php -text -buildscripts/phing/classes/phing/lib/Zip.php -text -buildscripts/phing/classes/phing/listener/AnsiColorLogger.php -text -buildscripts/phing/classes/phing/listener/BuildLogger.php -text -buildscripts/phing/classes/phing/listener/DefaultLogger.php -text -buildscripts/phing/classes/phing/listener/NoBannerLogger.php -text -buildscripts/phing/classes/phing/listener/PearLogger.php -text -buildscripts/phing/classes/phing/listener/XmlLogger.php -text buildscripts/phing/classes/phing/listener/defaults.properties -text -buildscripts/phing/classes/phing/mappers/FileNameMapper.php -text -buildscripts/phing/classes/phing/mappers/FlattenMapper.php -text -buildscripts/phing/classes/phing/mappers/GlobMapper.php -text -buildscripts/phing/classes/phing/mappers/IdentityMapper.php -text -buildscripts/phing/classes/phing/mappers/MergeMapper.php -text -buildscripts/phing/classes/phing/mappers/RegexpMapper.php -text -buildscripts/phing/classes/phing/parser/AbstractHandler.php -text -buildscripts/phing/classes/phing/parser/AbstractSAXParser.php -text -buildscripts/phing/classes/phing/parser/DataTypeHandler.php -text -buildscripts/phing/classes/phing/parser/ExpatParseException.php -text -buildscripts/phing/classes/phing/parser/ExpatParser.php -text -buildscripts/phing/classes/phing/parser/Location.php -text -buildscripts/phing/classes/phing/parser/NestedElementHandler.php -text -buildscripts/phing/classes/phing/parser/ProjectConfigurator.php -text -buildscripts/phing/classes/phing/parser/ProjectHandler.php -text -buildscripts/phing/classes/phing/parser/RootHandler.php -text -buildscripts/phing/classes/phing/parser/TargetHandler.php -text -buildscripts/phing/classes/phing/parser/TaskHandler.php -text -buildscripts/phing/classes/phing/system/io/BufferedReader.php -text -buildscripts/phing/classes/phing/system/io/BufferedWriter.php -text -buildscripts/phing/classes/phing/system/io/ConsoleReader.php -text -buildscripts/phing/classes/phing/system/io/FileReader.php -text -buildscripts/phing/classes/phing/system/io/FileSystem.php -text -buildscripts/phing/classes/phing/system/io/FileWriter.php -text -buildscripts/phing/classes/phing/system/io/FilterReader.php -text -buildscripts/phing/classes/phing/system/io/IOException.php -text -buildscripts/phing/classes/phing/system/io/PhingFile.php -text -buildscripts/phing/classes/phing/system/io/Reader.php -text -buildscripts/phing/classes/phing/system/io/StringReader.php -text -buildscripts/phing/classes/phing/system/io/TokenReader.php -text -buildscripts/phing/classes/phing/system/io/UnixFileSystem.php -text -buildscripts/phing/classes/phing/system/io/Win32FileSystem.php -text -buildscripts/phing/classes/phing/system/io/WinNTFileSystem.php -text -buildscripts/phing/classes/phing/system/io/Writer.php -text -buildscripts/phing/classes/phing/system/lang/Character.php -text -buildscripts/phing/classes/phing/system/lang/EventObject.php -text -buildscripts/phing/classes/phing/system/lang/FileNotFoundException.php -text -buildscripts/phing/classes/phing/system/lang/NullPointerException.php -text -buildscripts/phing/classes/phing/system/lang/SecurityException.php -text -buildscripts/phing/classes/phing/system/util/Message.php -text -buildscripts/phing/classes/phing/system/util/Properties.php -text -buildscripts/phing/classes/phing/system/util/Register.php -text -buildscripts/phing/classes/phing/system/util/Timer.php -text buildscripts/phing/classes/phing/tasks/defaults.properties -text -buildscripts/phing/classes/phing/tasks/ext/CapsuleTask.php -text -buildscripts/phing/classes/phing/tasks/ext/CreoleSQLExecTask.php -text -buildscripts/phing/classes/phing/tasks/ext/CreoleTask.php -text -buildscripts/phing/classes/phing/tasks/ext/MailTask.php -text -buildscripts/phing/classes/phing/tasks/ext/PackageAsPathTask.php -text -buildscripts/phing/classes/phing/tasks/ext/PearPackageTask.php -text -buildscripts/phing/classes/phing/tasks/ext/PhpLintTask.php -text -buildscripts/phing/classes/phing/tasks/ext/SmartyTask.php -text -buildscripts/phing/classes/phing/tasks/ext/TarTask.php -text -buildscripts/phing/classes/phing/tasks/ext/XmlLintTask.php -text -buildscripts/phing/classes/phing/tasks/ext/ZendCodeAnalyzerTask.php -text -buildscripts/phing/classes/phing/tasks/ext/ZipTask.php -text -buildscripts/phing/classes/phing/tasks/ext/coverage/CoverageMerger.php -text -buildscripts/phing/classes/phing/tasks/ext/coverage/CoverageMergerTask.php -text -buildscripts/phing/classes/phing/tasks/ext/coverage/CoverageReportTask.php -text -buildscripts/phing/classes/phing/tasks/ext/coverage/CoverageReportTransformer.php -text -buildscripts/phing/classes/phing/tasks/ext/coverage/CoverageSetupTask.php -text -buildscripts/phing/classes/phing/tasks/ext/ioncube/IoncubeComment.php -text -buildscripts/phing/classes/phing/tasks/ext/ioncube/IoncubeEncoderTask.php -text -buildscripts/phing/classes/phing/tasks/ext/ioncube/IoncubeLicenseTask.php -text -buildscripts/phing/classes/phing/tasks/ext/pearpackage/Fileset.php -text -buildscripts/phing/classes/phing/tasks/ext/phpdoc/PHPDocumentorTask.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/BatchTest.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/FormatterElement.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/PHPUnit2ReportTask.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/PHPUnit2ResultFormatter.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/PHPUnit2Task.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/PHPUnit2TestRunner.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/PHPUnit2Util.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/PlainPHPUnit2ResultFormatter.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/SummaryPHPUnit2ResultFormatter.php -text -buildscripts/phing/classes/phing/tasks/ext/phpunit2/XMLPHPUnit2ResultFormatter.php -text -buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php -text -buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php -text -buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestPlainResultFormatter.php -text -buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestResultFormatter.php -text -buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php -text -buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestTask.php -text -buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestXmlResultFormatter.php -text -buildscripts/phing/classes/phing/tasks/ext/svn/SvnBaseTask.php -text -buildscripts/phing/classes/phing/tasks/ext/svn/SvnExportTask.php -text -buildscripts/phing/classes/phing/tasks/ext/svn/SvnLastRevisionTask.php -text -buildscripts/phing/classes/phing/tasks/system/AdhocTask.php -text -buildscripts/phing/classes/phing/tasks/system/AdhocTaskdefTask.php -text -buildscripts/phing/classes/phing/tasks/system/AdhocTypedefTask.php -text -buildscripts/phing/classes/phing/tasks/system/AppendTask.php -text -buildscripts/phing/classes/phing/tasks/system/AvailableTask.php -text -buildscripts/phing/classes/phing/tasks/system/ChmodTask.php -text -buildscripts/phing/classes/phing/tasks/system/ConditionTask.php -text -buildscripts/phing/classes/phing/tasks/system/CopyTask.php -text -buildscripts/phing/classes/phing/tasks/system/CvsPassTask.php -text -buildscripts/phing/classes/phing/tasks/system/CvsTask.php -text -buildscripts/phing/classes/phing/tasks/system/DeleteTask.php -text -buildscripts/phing/classes/phing/tasks/system/EchoTask.php -text -buildscripts/phing/classes/phing/tasks/system/ExecTask.php -text -buildscripts/phing/classes/phing/tasks/system/ExitTask.php -text -buildscripts/phing/classes/phing/tasks/system/ForeachTask.php -text -buildscripts/phing/classes/phing/tasks/system/IfTask.php -text -buildscripts/phing/classes/phing/tasks/system/IncludePathTask.php -text -buildscripts/phing/classes/phing/tasks/system/InputTask.php -text -buildscripts/phing/classes/phing/tasks/system/MatchingTask.php -text -buildscripts/phing/classes/phing/tasks/system/MkdirTask.php -text -buildscripts/phing/classes/phing/tasks/system/MoveTask.php -text -buildscripts/phing/classes/phing/tasks/system/PhingCallTask.php -text -buildscripts/phing/classes/phing/tasks/system/PhingTask.php -text -buildscripts/phing/classes/phing/tasks/system/PhpEvalTask.php -text -buildscripts/phing/classes/phing/tasks/system/PropertyPromptTask.php -text -buildscripts/phing/classes/phing/tasks/system/PropertyTask.php -text -buildscripts/phing/classes/phing/tasks/system/ReflexiveTask.php -text -buildscripts/phing/classes/phing/tasks/system/ResolvePathTask.php -text -buildscripts/phing/classes/phing/tasks/system/SequentialTask.php -text -buildscripts/phing/classes/phing/tasks/system/TaskdefTask.php -text -buildscripts/phing/classes/phing/tasks/system/TouchTask.php -text -buildscripts/phing/classes/phing/tasks/system/TstampTask.php -text -buildscripts/phing/classes/phing/tasks/system/TypedefTask.php -text -buildscripts/phing/classes/phing/tasks/system/UpToDateTask.php -text -buildscripts/phing/classes/phing/tasks/system/WarnTask.php -text -buildscripts/phing/classes/phing/tasks/system/XsltTask.php -text -buildscripts/phing/classes/phing/tasks/system/condition/AndCondition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/Condition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/ConditionBase.php -text -buildscripts/phing/classes/phing/tasks/system/condition/ContainsCondition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/EqualsCondition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/IsFalseCondition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/IsSetCondition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/IsTrueCondition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/NotCondition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/OrCondition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/OsCondition.php -text -buildscripts/phing/classes/phing/tasks/system/condition/ReferenceExistsCondition.php -text -buildscripts/phing/classes/phing/types/AbstractFileSet.php -text -buildscripts/phing/classes/phing/types/Commandline.php -text -buildscripts/phing/classes/phing/types/DataType.php -text -buildscripts/phing/classes/phing/types/Description.php -text -buildscripts/phing/classes/phing/types/DirSet.php -text -buildscripts/phing/classes/phing/types/FileList.php -text -buildscripts/phing/classes/phing/types/FileSet.php -text -buildscripts/phing/classes/phing/types/FilterChain.php -text -buildscripts/phing/classes/phing/types/Mapper.php -text -buildscripts/phing/classes/phing/types/Parameter.php -text -buildscripts/phing/classes/phing/types/Parameterizable.php -text -buildscripts/phing/classes/phing/types/Path.php -text -buildscripts/phing/classes/phing/types/PatternSet.php -text -buildscripts/phing/classes/phing/types/PhingFilterReader.php -text -buildscripts/phing/classes/phing/types/Reference.php -text -buildscripts/phing/classes/phing/types/RegularExpression.php -text -buildscripts/phing/classes/phing/types/TokenReader.php -text -buildscripts/phing/classes/phing/types/TokenSource.php -text buildscripts/phing/classes/phing/types/defaults.properties -text -buildscripts/phing/classes/phing/types/selectors/AndSelector.php -text -buildscripts/phing/classes/phing/types/selectors/BaseExtendSelector.php -text -buildscripts/phing/classes/phing/types/selectors/BaseSelector.php -text -buildscripts/phing/classes/phing/types/selectors/BaseSelectorContainer.php -text -buildscripts/phing/classes/phing/types/selectors/ContainsRegexpSelector.php -text -buildscripts/phing/classes/phing/types/selectors/ContainsSelector.php -text -buildscripts/phing/classes/phing/types/selectors/DateSelector.php -text -buildscripts/phing/classes/phing/types/selectors/DependSelector.php -text -buildscripts/phing/classes/phing/types/selectors/DepthSelector.php -text -buildscripts/phing/classes/phing/types/selectors/ExtendFileSelector.php -text -buildscripts/phing/classes/phing/types/selectors/ExtendSelector.php -text -buildscripts/phing/classes/phing/types/selectors/FileSelector.php -text -buildscripts/phing/classes/phing/types/selectors/FilenameSelector.php -text -buildscripts/phing/classes/phing/types/selectors/MajoritySelector.php -text -buildscripts/phing/classes/phing/types/selectors/NoneSelector.php -text -buildscripts/phing/classes/phing/types/selectors/NotSelector.php -text -buildscripts/phing/classes/phing/types/selectors/OrSelector.php -text -buildscripts/phing/classes/phing/types/selectors/PresentSelector.php -text -buildscripts/phing/classes/phing/types/selectors/SelectSelector.php -text -buildscripts/phing/classes/phing/types/selectors/SelectorContainer.php -text -buildscripts/phing/classes/phing/types/selectors/SelectorScanner.php -text -buildscripts/phing/classes/phing/types/selectors/SelectorUtils.php -text -buildscripts/phing/classes/phing/types/selectors/SizeSelector.php -text -buildscripts/phing/classes/phing/types/selectors/TypeSelector.php -text -buildscripts/phing/classes/phing/util/DirectoryScanner.php -text -buildscripts/phing/classes/phing/util/ExtendedFileStream.php -text -buildscripts/phing/classes/phing/util/FileUtils.php -text -buildscripts/phing/classes/phing/util/LogWriter.php -text -buildscripts/phing/classes/phing/util/PathTokenizer.php -text -buildscripts/phing/classes/phing/util/SourceFileScanner.php -text -buildscripts/phing/classes/phing/util/StringHelper.php -text -buildscripts/phing/classes/phing/util/regexp/PregEngine.php -text -buildscripts/phing/classes/phing/util/regexp/Regexp.php -text -buildscripts/phing/classes/phing/util/regexp/RegexpEngine.php -text buildscripts/phing/etc/VERSION.TXT -text buildscripts/phing/etc/coverage-frames.xsl -text buildscripts/phing/etc/log.xsl -text buildscripts/phing/etc/phpunit2-frames.xsl -text buildscripts/phing/etc/phpunit2-noframes.xsl -text buildscripts/phing/etc/str.replace.function.xsl -text -buildscripts/phing/pear/BuildPhingPEARPackageTask.php -text buildscripts/phing/pear/build.xml -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/phing/tasks/BuildPradoPEARPackageTask.php -text -buildscripts/phing/tasks/ManualIndexTask.php -text -buildscripts/phing/tasks/PhpLintTask.php -text -buildscripts/phing/tasks/PradoDocTask.php -text -buildscripts/phing/tasks/PradoPackageTask.php -text -buildscripts/phing/tasks/PradoPearTask.php -text -buildscripts/phing/tasks/PradoQuickStartDocs.php -text -buildscripts/phing/tasks/PradoSimpleTestTask.php -text -buildscripts/phing/tasks/PradoTestTask.php -text -buildscripts/phing/tasks/PradoVersionTask.php -text -buildscripts/phing/tasks/QuickstartIndexTask.php -text -buildscripts/phing/tasks/XmlLintTask.php -text -buildscripts/phing/tasks/ZendCodeAnalyzerTask.php -text -buildscripts/phpbuilder/build.php -text -buildscripts/setup.php -text -buildscripts/texbuilder/Page2Tex.php -text -buildscripts/texbuilder/quickstart/build.php -text -buildscripts/texbuilder/quickstart/pages.php -text buildscripts/texbuilder/quickstart/quickstart.tex -text -buildscripts/texbuilder/sqlmap/build.php -text -buildscripts/texbuilder/sqlmap/pages.php -text buildscripts/texbuilder/sqlmap/sqlmap.tex -text buildscripts/texbuilder/time-tracker/db.vsd -text -buildscripts/texbuilder/time-tracker/pages.php -text buildscripts/texbuilder/time-tracker/preface.tex -text buildscripts/texbuilder/time-tracker/time-tracker.tex -text -buildscripts/wikibuilder/DumpSkin.php -text -buildscripts/wikibuilder/build.php -text buildscripts/wikibuilder/dumpHTML.inc -text -buildscripts/wikibuilder/dumpHTML.php -text buildscripts/wikibuilder/external.png -text buildscripts/wikibuilder/main.css -text -demos/address-book/index.php -text -demos/address-book/index_php.php -text demos/address-book/protected/.htaccess -text -demos/address-book/protected/application.php -text demos/address-book/protected/application.xml -text -demos/address-book/protected/pages/AddressProvider.php -text -demos/address-book/protected/pages/AddressRecord.php -text -demos/address-book/protected/pages/FlexApp.php -text demos/address-book/protected/pages/FlexApp.tpl -text demos/address-book/protected/pages/Home.page -text demos/address-book/protected/pages/flex/.actionScriptProperties -text demos/address-book/protected/pages/flex/.flexProperties -text demos/address-book/protected/pages/flex/.project -text demos/address-book/protected/pages/flex/.settings/org.eclipse.core.resources.prefs -text -demos/address-book/protected/pages/flex/bin/AC_OETags.js -text demos/address-book/protected/pages/flex/bin/flex_address_book-debug.html -text demos/address-book/protected/pages/flex/bin/flex_address_book.html -text demos/address-book/protected/pages/flex/bin/flex_address_book.swf -text demos/address-book/protected/pages/flex/bin/history.htm -text -demos/address-book/protected/pages/flex/bin/history.js -text demos/address-book/protected/pages/flex/bin/history.swf -text demos/address-book/protected/pages/flex/bin/playerProductInstall.swf -text demos/address-book/protected/pages/flex/flex_address_book.mxml -text -demos/address-book/protected/pages/flex/html-template/AC_OETags.js -text demos/address-book/protected/pages/flex/html-template/history.htm -text -demos/address-book/protected/pages/flex/html-template/history.js -text demos/address-book/protected/pages/flex/html-template/history.swf -text demos/address-book/protected/pages/flex/html-template/index.template.html -text demos/address-book/protected/pages/flex/html-template/playerProductInstall.swf -text demos/address-book/protected/pages/sqlite.db -text -demos/blog-tutorial/index.php -text demos/blog-tutorial/protected/.htaccess -text demos/blog-tutorial/protected/application.xml -text -demos/blog-tutorial/protected/common/InfoBox.php -text -demos/blog-tutorial/protected/common/NoteBox.php -text -demos/blog-tutorial/protected/common/TipBox.php -text -demos/blog-tutorial/protected/common/TopicList.php -text demos/blog-tutorial/protected/common/TopicList.tpl -text demos/blog-tutorial/protected/common/fr/TopicList.tpl -text demos/blog-tutorial/protected/common/id/TopicList.tpl -text -demos/blog-tutorial/protected/layout/MainLayout.php -text demos/blog-tutorial/protected/layout/MainLayout.tpl -text demos/blog-tutorial/protected/layout/fr/MainLayout.tpl -text demos/blog-tutorial/protected/layout/id/MainLayout.tpl -text @@ -1465,115 +1036,65 @@ demos/blog-tutorial/protected/pages/fr/Overview.page -text demos/blog-tutorial/protected/pages/fr/Requirements.page -text demos/blog-tutorial/protected/pages/id/Overview.page -text demos/blog-tutorial/protected/pages/id/Requirements.page -text -demos/blog-tutorial/samples/day1/blog/index.php -text demos/blog-tutorial/samples/day1/blog/protected/.htaccess -text demos/blog-tutorial/samples/day1/blog/protected/application.xml -text -demos/blog-tutorial/samples/day1/blog/protected/layouts/MainLayout.php -text demos/blog-tutorial/samples/day1/blog/protected/layouts/MainLayout.tpl -text demos/blog-tutorial/samples/day1/blog/protected/pages/Contact.page -text -demos/blog-tutorial/samples/day1/blog/protected/pages/Contact.php -text demos/blog-tutorial/samples/day1/blog/protected/pages/Home.page -text -demos/blog-tutorial/samples/day2/blog/index.php -text demos/blog-tutorial/samples/day2/blog/protected/.htaccess -text demos/blog-tutorial/samples/day2/blog/protected/application.xml -text demos/blog-tutorial/samples/day2/blog/protected/data/blog.db -text -demos/blog-tutorial/samples/day2/blog/protected/database/PostRecord.php -text -demos/blog-tutorial/samples/day2/blog/protected/database/UserRecord.php -text -demos/blog-tutorial/samples/day2/blog/protected/layouts/MainLayout.php -text demos/blog-tutorial/samples/day2/blog/protected/layouts/MainLayout.tpl -text demos/blog-tutorial/samples/day2/blog/protected/pages/Contact.page -text -demos/blog-tutorial/samples/day2/blog/protected/pages/Contact.php -text demos/blog-tutorial/samples/day2/blog/protected/pages/Home.page -text demos/blog-tutorial/samples/day2/blog/protected/schema.sql -text -demos/blog-tutorial/samples/day3/blog/index.php -text demos/blog-tutorial/samples/day3/blog/protected/.htaccess -text -demos/blog-tutorial/samples/day3/blog/protected/BlogUser.php -text demos/blog-tutorial/samples/day3/blog/protected/application.xml -text demos/blog-tutorial/samples/day3/blog/protected/data/blog.db -text -demos/blog-tutorial/samples/day3/blog/protected/database/PostRecord.php -text -demos/blog-tutorial/samples/day3/blog/protected/database/UserRecord.php -text -demos/blog-tutorial/samples/day3/blog/protected/layouts/MainLayout.php -text demos/blog-tutorial/samples/day3/blog/protected/layouts/MainLayout.tpl -text demos/blog-tutorial/samples/day3/blog/protected/pages/Contact.page -text -demos/blog-tutorial/samples/day3/blog/protected/pages/Contact.php -text demos/blog-tutorial/samples/day3/blog/protected/pages/Home.page -text demos/blog-tutorial/samples/day3/blog/protected/pages/users/AdminUser.page -text -demos/blog-tutorial/samples/day3/blog/protected/pages/users/AdminUser.php -text demos/blog-tutorial/samples/day3/blog/protected/pages/users/EditUser.page -text -demos/blog-tutorial/samples/day3/blog/protected/pages/users/EditUser.php -text demos/blog-tutorial/samples/day3/blog/protected/pages/users/LoginUser.page -text -demos/blog-tutorial/samples/day3/blog/protected/pages/users/LoginUser.php -text demos/blog-tutorial/samples/day3/blog/protected/pages/users/NewUser.page -text -demos/blog-tutorial/samples/day3/blog/protected/pages/users/NewUser.php -text demos/blog-tutorial/samples/day3/blog/protected/pages/users/config.xml -text demos/blog-tutorial/samples/day3/blog/protected/schema.sql -text -demos/blog-tutorial/samples/day4/blog/index.php -text demos/blog-tutorial/samples/day4/blog/protected/.htaccess -text -demos/blog-tutorial/samples/day4/blog/protected/BlogUser.php -text demos/blog-tutorial/samples/day4/blog/protected/application.xml -text demos/blog-tutorial/samples/day4/blog/protected/data/blog.db -text -demos/blog-tutorial/samples/day4/blog/protected/database/PostRecord.php -text -demos/blog-tutorial/samples/day4/blog/protected/database/UserRecord.php -text -demos/blog-tutorial/samples/day4/blog/protected/layouts/MainLayout.php -text demos/blog-tutorial/samples/day4/blog/protected/layouts/MainLayout.tpl -text demos/blog-tutorial/samples/day4/blog/protected/pages/Contact.page -text -demos/blog-tutorial/samples/day4/blog/protected/pages/Contact.php -text demos/blog-tutorial/samples/day4/blog/protected/pages/Home.page -text demos/blog-tutorial/samples/day4/blog/protected/pages/posts/EditPost.page -text -demos/blog-tutorial/samples/day4/blog/protected/pages/posts/EditPost.php -text demos/blog-tutorial/samples/day4/blog/protected/pages/posts/ListPost.page -text -demos/blog-tutorial/samples/day4/blog/protected/pages/posts/ListPost.php -text demos/blog-tutorial/samples/day4/blog/protected/pages/posts/NewPost.page -text -demos/blog-tutorial/samples/day4/blog/protected/pages/posts/NewPost.php -text -demos/blog-tutorial/samples/day4/blog/protected/pages/posts/PostRenderer.php -text demos/blog-tutorial/samples/day4/blog/protected/pages/posts/PostRenderer.tpl -text demos/blog-tutorial/samples/day4/blog/protected/pages/posts/ReadPost.page -text -demos/blog-tutorial/samples/day4/blog/protected/pages/posts/ReadPost.php -text demos/blog-tutorial/samples/day4/blog/protected/pages/posts/config.xml -text demos/blog-tutorial/samples/day4/blog/protected/pages/users/AdminUser.page -text -demos/blog-tutorial/samples/day4/blog/protected/pages/users/AdminUser.php -text demos/blog-tutorial/samples/day4/blog/protected/pages/users/EditUser.page -text -demos/blog-tutorial/samples/day4/blog/protected/pages/users/EditUser.php -text demos/blog-tutorial/samples/day4/blog/protected/pages/users/LoginUser.page -text -demos/blog-tutorial/samples/day4/blog/protected/pages/users/LoginUser.php -text demos/blog-tutorial/samples/day4/blog/protected/pages/users/NewUser.page -text -demos/blog-tutorial/samples/day4/blog/protected/pages/users/NewUser.php -text demos/blog-tutorial/samples/day4/blog/protected/pages/users/config.xml -text demos/blog-tutorial/samples/day4/blog/protected/schema.sql -text -demos/blog-tutorial/samples/day5/blog/index.php -text demos/blog-tutorial/samples/day5/blog/protected/.htaccess -text -demos/blog-tutorial/samples/day5/blog/protected/BlogErrorHandler.php -text -demos/blog-tutorial/samples/day5/blog/protected/BlogException.php -text -demos/blog-tutorial/samples/day5/blog/protected/BlogUser.php -text demos/blog-tutorial/samples/day5/blog/protected/application.xml -text demos/blog-tutorial/samples/day5/blog/protected/data/blog.db -text -demos/blog-tutorial/samples/day5/blog/protected/database/PostRecord.php -text -demos/blog-tutorial/samples/day5/blog/protected/database/UserRecord.php -text demos/blog-tutorial/samples/day5/blog/protected/error.html -text -demos/blog-tutorial/samples/day5/blog/protected/layouts/MainLayout.php -text demos/blog-tutorial/samples/day5/blog/protected/layouts/MainLayout.tpl -text demos/blog-tutorial/samples/day5/blog/protected/pages/Contact.page -text -demos/blog-tutorial/samples/day5/blog/protected/pages/Contact.php -text demos/blog-tutorial/samples/day5/blog/protected/pages/Home.page -text demos/blog-tutorial/samples/day5/blog/protected/pages/posts/EditPost.page -text -demos/blog-tutorial/samples/day5/blog/protected/pages/posts/EditPost.php -text demos/blog-tutorial/samples/day5/blog/protected/pages/posts/ListPost.page -text -demos/blog-tutorial/samples/day5/blog/protected/pages/posts/ListPost.php -text demos/blog-tutorial/samples/day5/blog/protected/pages/posts/NewPost.page -text -demos/blog-tutorial/samples/day5/blog/protected/pages/posts/NewPost.php -text -demos/blog-tutorial/samples/day5/blog/protected/pages/posts/PostRenderer.php -text demos/blog-tutorial/samples/day5/blog/protected/pages/posts/PostRenderer.tpl -text demos/blog-tutorial/samples/day5/blog/protected/pages/posts/ReadPost.page -text -demos/blog-tutorial/samples/day5/blog/protected/pages/posts/ReadPost.php -text demos/blog-tutorial/samples/day5/blog/protected/pages/posts/config.xml -text demos/blog-tutorial/samples/day5/blog/protected/pages/users/AdminUser.page -text -demos/blog-tutorial/samples/day5/blog/protected/pages/users/AdminUser.php -text demos/blog-tutorial/samples/day5/blog/protected/pages/users/EditUser.page -text -demos/blog-tutorial/samples/day5/blog/protected/pages/users/EditUser.php -text demos/blog-tutorial/samples/day5/blog/protected/pages/users/LoginUser.page -text -demos/blog-tutorial/samples/day5/blog/protected/pages/users/LoginUser.php -text demos/blog-tutorial/samples/day5/blog/protected/pages/users/NewUser.page -text -demos/blog-tutorial/samples/day5/blog/protected/pages/users/NewUser.php -text demos/blog-tutorial/samples/day5/blog/protected/pages/users/config.xml -text demos/blog-tutorial/samples/day5/blog/protected/schema.sql -text demos/blog-tutorial/samples/day5/blog/themes/Basic/button.skin -text @@ -1590,103 +1111,52 @@ demos/blog-tutorial/themes/PradoSoft/mantisbg.jpg -text demos/blog-tutorial/themes/PradoSoft/mantissample.jpg -text demos/blog-tutorial/themes/PradoSoft/pradologo.gif -text demos/blog-tutorial/themes/PradoSoft/style.css -text -demos/blog/index.php -text -demos/blog/index_php.php -text demos/blog/protected/.htaccess -text -demos/blog/protected/Common/BlogDataModule.php -text -demos/blog/protected/Common/BlogErrorHandler.php -text -demos/blog/protected/Common/BlogException.php -text -demos/blog/protected/Common/BlogPage.php -text -demos/blog/protected/Common/BlogUser.php -text -demos/blog/protected/Common/BlogUserManager.php -text -demos/blog/protected/Common/XListMenu.php -text demos/blog/protected/Common/messages.txt -text demos/blog/protected/Common/schema.sql -text -demos/blog/protected/Data/Settings.php -text demos/blog/protected/Data/Settings.xml -text -demos/blog/protected/Layouts/MainLayout.php -text demos/blog/protected/Layouts/MainLayout.tpl -text -demos/blog/protected/Pages/Admin/AdminMenu.php -text demos/blog/protected/Pages/Admin/AdminMenu.tpl -text demos/blog/protected/Pages/Admin/ConfigMan.page -text -demos/blog/protected/Pages/Admin/ConfigMan.php -text demos/blog/protected/Pages/Admin/PostMan.page -text -demos/blog/protected/Pages/Admin/PostMan.php -text demos/blog/protected/Pages/Admin/UserMan.page -text -demos/blog/protected/Pages/Admin/UserMan.php -text -demos/blog/protected/Pages/Admin/config.php -text demos/blog/protected/Pages/Admin/config.xml -text demos/blog/protected/Pages/ErrorReport.page -text -demos/blog/protected/Pages/ErrorReport.php -text demos/blog/protected/Pages/Posts/EditCategory.page -text -demos/blog/protected/Pages/Posts/EditCategory.php -text demos/blog/protected/Pages/Posts/EditPost.page -text -demos/blog/protected/Pages/Posts/EditPost.php -text demos/blog/protected/Pages/Posts/ListPost.page -text -demos/blog/protected/Pages/Posts/ListPost.php -text demos/blog/protected/Pages/Posts/MyPost.page -text -demos/blog/protected/Pages/Posts/MyPost.php -text demos/blog/protected/Pages/Posts/NewCategory.page -text -demos/blog/protected/Pages/Posts/NewCategory.php -text demos/blog/protected/Pages/Posts/NewPost.page -text -demos/blog/protected/Pages/Posts/NewPost.php -text demos/blog/protected/Pages/Posts/ViewPost.page -text -demos/blog/protected/Pages/Posts/ViewPost.php -text -demos/blog/protected/Pages/Posts/config.php -text demos/blog/protected/Pages/Posts/config.xml -text demos/blog/protected/Pages/SearchPost.page -text -demos/blog/protected/Pages/SearchPost.php -text demos/blog/protected/Pages/Users/EditUser.page -text -demos/blog/protected/Pages/Users/EditUser.php -text demos/blog/protected/Pages/Users/NewUser.page -text -demos/blog/protected/Pages/Users/NewUser.php -text demos/blog/protected/Pages/Users/ViewUser.page -text -demos/blog/protected/Pages/Users/ViewUser.php -text demos/blog/protected/Pages/Users/config.xml -text -demos/blog/protected/Portlets/AccountPortlet.php -text demos/blog/protected/Portlets/AccountPortlet.tpl -text -demos/blog/protected/Portlets/ArchivePortlet.php -text demos/blog/protected/Portlets/ArchivePortlet.tpl -text -demos/blog/protected/Portlets/CategoryPortlet.php -text demos/blog/protected/Portlets/CategoryPortlet.tpl -text -demos/blog/protected/Portlets/CommentPortlet.php -text demos/blog/protected/Portlets/CommentPortlet.tpl -text -demos/blog/protected/Portlets/LoginPortlet.php -text demos/blog/protected/Portlets/LoginPortlet.tpl -text -demos/blog/protected/Portlets/Portlet.php -text -demos/blog/protected/Portlets/SearchPortlet.php -text demos/blog/protected/Portlets/SearchPortlet.tpl -text -demos/blog/protected/application.php -text demos/blog/protected/application.xml -text demos/blog/themes/Fall/style.css -text demos/blog/themes/Spring/style.css -text demos/blog/themes/Summer/style.css -text demos/blog/themes/Winter/style.css -text -demos/chat/index.php -text -demos/chat/index_php.php -text demos/chat/protected/.htaccess -text -demos/chat/protected/App_Code/ChatBufferRecord.php -text -demos/chat/protected/App_Code/ChatUserManager.php -text -demos/chat/protected/App_Code/ChatUserRecord.php -text demos/chat/protected/App_Code/chat.db -text -demos/chat/protected/application.php -text demos/chat/protected/application.xml -text demos/chat/protected/pages/Home.page -text -demos/chat/protected/pages/Home.php -text demos/chat/protected/pages/Login.page -text -demos/chat/protected/pages/Login.php -text -demos/chat/protected/pages/config.php -text demos/chat/protected/pages/config.xml -text demos/chat/protected/pages/send.gif -text demos/chat/protected/pages/send.png -text demos/chat/protected/pages/style.css -text -demos/composer/index.php -text -demos/composer/index2.php -text demos/composer/protected/.htaccess -text -demos/composer/protected/pages/ClassDefinition.php -text demos/composer/protected/pages/Home.page -text -demos/composer/protected/pages/Home.php -text -demos/composer/protected/pages/Layout.php -text demos/composer/protected/pages/Layout.tpl -text demos/composer/themes/PradoSoft/comments.gif -text demos/composer/themes/PradoSoft/eventdef.gif -text @@ -1695,56 +1165,30 @@ demos/composer/themes/PradoSoft/pradoheader.gif -text demos/composer/themes/PradoSoft/propertydef.gif -text demos/composer/themes/PradoSoft/style.css -text demos/composer/themes/Simple/style.css -text -demos/currency-converter/index.php -text demos/currency-converter/protected/.htaccess -text demos/currency-converter/protected/pages/Home.page -text -demos/currency-converter/protected/pages/Home.php -text demos/currency-converter/themes/Basic/common.css -text -demos/helloworld/index.php -text demos/helloworld/protected/.htaccess -text demos/helloworld/protected/pages/Home.page -text -demos/helloworld/protected/pages/Home.php -text -demos/northwind-db/index.php -text -demos/northwind-db/index_php.php -text demos/northwind-db/protected/.htaccess -text -demos/northwind-db/protected/application.php -text demos/northwind-db/protected/application.xml -text demos/northwind-db/protected/data/Northwind.db -text -demos/northwind-db/protected/database/Category.php -text -demos/northwind-db/protected/database/Customer.php -text -demos/northwind-db/protected/database/Employee.php -text -demos/northwind-db/protected/database/Order.php -text -demos/northwind-db/protected/database/OrderDetail.php -text -demos/northwind-db/protected/database/Product.php -text -demos/northwind-db/protected/database/Region.php -text -demos/northwind-db/protected/database/Shipper.php -text -demos/northwind-db/protected/database/Supplier.php -text -demos/northwind-db/protected/database/Territory.php -text demos/northwind-db/protected/database/sqlmap.xml -text demos/northwind-db/protected/pages/Home.page -text demos/northwind-db/protected/pages/NorthwindCrud.page -text -demos/northwind-db/protected/pages/NorthwindCrud.php -text demos/northwind-db/protected/pages/northwind.gif -text -demos/personal/index.php -text -demos/personal/index_php.php -text demos/personal/protected/.htaccess -text -demos/personal/protected/Common/LoginPortlet.php -text demos/personal/protected/Common/LoginPortlet.tpl -text -demos/personal/protected/Common/MainMenu.php -text demos/personal/protected/Common/MainMenu.tpl -text demos/personal/protected/Pages/Albums.page -text demos/personal/protected/Pages/Home.page -text -demos/personal/protected/Pages/Layout.php -text demos/personal/protected/Pages/Layout.tpl -text demos/personal/protected/Pages/Links.page -text demos/personal/protected/Pages/Register.page -text -demos/personal/protected/Pages/Register.php -text demos/personal/protected/Pages/Resume.page -text demos/personal/protected/Pages/Settings.page -text demos/personal/protected/Pages/UserLogin.page -text -demos/personal/protected/Pages/config.php -text demos/personal/protected/Pages/config.xml -text -demos/personal/protected/application.php -text demos/personal/protected/application.xml -text demos/personal/themes/BlueTheme/buttons.skin -text demos/personal/themes/BlueTheme/icon_profile.gif -text @@ -2872,62 +2316,14 @@ editors/Textmate/Prado.tmbundle/Syntaxes/Prado[!!-~]PHP.tmLanguage -text editors/Textmate/Prado.tmbundle/Syntaxes/Prado[!!-~]Template.tmLanguage -text editors/Textmate/Prado.tmbundle/info.plist -text framework/.htaccess -text -framework/3rdParty/FirePHPCore/FirePHP.class.php eol=lf framework/3rdParty/FirePHPCore/FirePHP.class.php4 -text framework/3rdParty/FirePHPCore/LICENSE -text -framework/3rdParty/FirePHPCore/fb.php eol=lf framework/3rdParty/FirePHPCore/fb.php4 -text framework/3rdParty/Markdown/License.text -text -framework/3rdParty/Markdown/MarkdownParser.php -text -framework/3rdParty/PhpShell/PHP/Shell.php -text -framework/3rdParty/PhpShell/PHP/Shell/Commands.php -text -framework/3rdParty/PhpShell/PHP/Shell/Extensions.php -text -framework/3rdParty/PhpShell/PHP/Shell/Extensions/Autoload.php -text -framework/3rdParty/PhpShell/PHP/Shell/Extensions/AutoloadDebug.php -text -framework/3rdParty/PhpShell/PHP/Shell/Extensions/Colour.php -text -framework/3rdParty/PhpShell/PHP/Shell/Extensions/ExecutionTime.php -text -framework/3rdParty/PhpShell/PHP/Shell/Extensions/InlineHelp.php -text -framework/3rdParty/PhpShell/PHP/Shell/Extensions/LoadScript.php -text -framework/3rdParty/PhpShell/PHP/Shell/Extensions/Prototypes.php -text -framework/3rdParty/PhpShell/PHP/Shell/Extensions/VerbosePrint.php -text -framework/3rdParty/PhpShell/PHP/Shell/Options.php -text framework/3rdParty/PhpShell/README -text -framework/3rdParty/PhpShell/php-shell-cmd.php -text -framework/3rdParty/PhpShell/php-shell-init.php -text framework/3rdParty/ReCaptcha/LICENSE -text -framework/3rdParty/ReCaptcha/recaptchalib.php -text -framework/3rdParty/SafeHtml/HTMLSax3.php -text -framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php -text -framework/3rdParty/SafeHtml/HTMLSax3/States.php -text -framework/3rdParty/SafeHtml/TSafeHtmlParser.php -text framework/3rdParty/SafeHtml/license.txt -text framework/3rdParty/SafeHtml/readme.txt -text -framework/3rdParty/TextHighlighter/Text/Highlighter.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/ABAP.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/CPP.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/CSS.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/DIFF.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/DTD.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/Generator.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/HTML.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/JAVA.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/JAVASCRIPT.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/MYSQL.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/PERL.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/PHP.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/PRADO.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/PYTHON.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/RUBY.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Array.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/BB.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Html.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/HtmlTags.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/JSON.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/XML.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/SQL.php -text -framework/3rdParty/TextHighlighter/Text/Highlighter/XML.php -text framework/3rdParty/TextHighlighter/Text/README -text framework/3rdParty/TextHighlighter/Text/TODO -text framework/3rdParty/TextHighlighter/Text/abap.xml -text @@ -2954,121 +2350,14 @@ framework/3rdParty/TextHighlighter/highlight.css -text framework/3rdParty/TinyMCE/license.txt -text framework/3rdParty/TinyMCE/tiny_mce.md5 -text framework/3rdParty/TinyMCE/tiny_mce.tar -text -framework/3rdParty/WsdlGen/Wsdl.php -text -framework/3rdParty/WsdlGen/WsdlGenerator.php -text -framework/3rdParty/WsdlGen/WsdlMessage.php -text -framework/3rdParty/WsdlGen/WsdlOperation.php -text framework/3rdParty/readme.html -text -framework/Caching/TAPCCache.php -text -framework/Caching/TCache.php -text -framework/Caching/TDbCache.php -text -framework/Caching/TMemCache.php -text -framework/Caching/TSqliteCache.php -text -framework/Caching/TXCache.php -text -framework/Collections/TAttributeCollection.php -text -framework/Collections/TDummyDataSource.php -text -framework/Collections/TList.php -text -framework/Collections/TListItemCollection.php -text -framework/Collections/TMap.php -text -framework/Collections/TPagedDataSource.php -text -framework/Collections/TPagedList.php -text -framework/Collections/TPriorityList.php -text -framework/Collections/TPriorityMap.php -text -framework/Collections/TQueue.php -text -framework/Collections/TStack.php -text -framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php -text framework/Data/ActiveRecord/Exceptions/messages.txt -text -framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php -text -framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php -text -framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php -text -framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php -text -framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php -text -framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php -text -framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php -text -framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php -text -framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php -text -framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php -text -framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php -text -framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php -text -framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php -text -framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php -text -framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php -text framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.tpl -text -framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php -text framework/Data/ActiveRecord/Scaffold/TScaffoldListView.tpl -text -framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php -text framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.tpl -text -framework/Data/ActiveRecord/Scaffold/TScaffoldView.php -text framework/Data/ActiveRecord/Scaffold/TScaffoldView.tpl -text framework/Data/ActiveRecord/Scaffold/style.css -text -framework/Data/ActiveRecord/TActiveRecord.php -text -framework/Data/ActiveRecord/TActiveRecordConfig.php -text -framework/Data/ActiveRecord/TActiveRecordCriteria.php -text -framework/Data/ActiveRecord/TActiveRecordGateway.php -text -framework/Data/ActiveRecord/TActiveRecordManager.php -text -framework/Data/Common/Mssql/TMssqlCommandBuilder.php -text -framework/Data/Common/Mssql/TMssqlMetaData.php -text -framework/Data/Common/Mssql/TMssqlTableColumn.php -text -framework/Data/Common/Mssql/TMssqlTableInfo.php -text -framework/Data/Common/Mysql/TMysqlCommandBuilder.php -text -framework/Data/Common/Mysql/TMysqlMetaData.php -text -framework/Data/Common/Mysql/TMysqlTableColumn.php -text -framework/Data/Common/Mysql/TMysqlTableInfo.php -text -framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php -text -framework/Data/Common/Pgsql/TPgsqlMetaData.php -text -framework/Data/Common/Pgsql/TPgsqlTableColumn.php -text -framework/Data/Common/Pgsql/TPgsqlTableInfo.php -text -framework/Data/Common/Sqlite/TSqliteCommandBuilder.php -text -framework/Data/Common/Sqlite/TSqliteMetaData.php -text -framework/Data/Common/Sqlite/TSqliteTableColumn.php -text -framework/Data/Common/Sqlite/TSqliteTableInfo.php -text -framework/Data/Common/TDbCommandBuilder.php -text -framework/Data/Common/TDbMetaData.php -text -framework/Data/Common/TDbTableColumn.php -text -framework/Data/Common/TDbTableInfo.php -text -framework/Data/DataGateway/TDataGatewayCommand.php -text -framework/Data/DataGateway/TSqlCriteria.php -text -framework/Data/DataGateway/TTableGateway.php -text -framework/Data/SqlMap/Configuration/TDiscriminator.php -text -framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php -text -framework/Data/SqlMap/Configuration/TParameterMap.php -text -framework/Data/SqlMap/Configuration/TParameterProperty.php -text -framework/Data/SqlMap/Configuration/TResultMap.php -text -framework/Data/SqlMap/Configuration/TResultProperty.php -text -framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php -text -framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php -text -framework/Data/SqlMap/Configuration/TSqlMapStatement.php -text -framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php -text -framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php -text -framework/Data/SqlMap/DataMapper/TLazyLoadList.php -text -framework/Data/SqlMap/DataMapper/TPropertyAccess.php -text -framework/Data/SqlMap/DataMapper/TSqlMapCache.php -text -framework/Data/SqlMap/DataMapper/TSqlMapException.php -text -framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php -text -framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php -text framework/Data/SqlMap/DataMapper/messages.txt -text -framework/Data/SqlMap/Statements/IMappedStatement.php -text -framework/Data/SqlMap/Statements/TCachingStatement.php -text -framework/Data/SqlMap/Statements/TDeleteMappedStatement.php -text -framework/Data/SqlMap/Statements/TInsertMappedStatement.php -text -framework/Data/SqlMap/Statements/TMappedStatement.php -text -framework/Data/SqlMap/Statements/TPreparedCommand.php -text -framework/Data/SqlMap/Statements/TPreparedStatement.php -text -framework/Data/SqlMap/Statements/TPreparedStatementFactory.php -text -framework/Data/SqlMap/Statements/TSelectMappedStatement.php -text -framework/Data/SqlMap/Statements/TSimpleDynamicSql.php -text -framework/Data/SqlMap/Statements/TStaticSql.php -text -framework/Data/SqlMap/Statements/TUpdateMappedStatement.php -text -framework/Data/SqlMap/TSqlMapConfig.php -text -framework/Data/SqlMap/TSqlMapGateway.php -text -framework/Data/SqlMap/TSqlMapManager.php -text -framework/Data/TDataSourceConfig.php -text -framework/Data/TDbCommand.php -text -framework/Data/TDbConnection.php -text -framework/Data/TDbDataReader.php -text -framework/Data/TDbTransaction.php -text -framework/Exceptions/TErrorHandler.php -text -framework/Exceptions/TException.php -text framework/Exceptions/messages/messages-id.txt -text framework/Exceptions/messages/messages-zh.txt -text framework/Exceptions/messages/messages.txt -text @@ -3101,35 +2390,6 @@ framework/Exceptions/templates/exception-id.html -text framework/Exceptions/templates/exception-zh.html -text framework/Exceptions/templates/exception.html -text framework/Exceptions/templates/readme.txt -text -framework/I18N/TChoiceFormat.php -text -framework/I18N/TDateFormat.php -text -framework/I18N/TGlobalization.php -text -framework/I18N/TGlobalizationAutoDetect.php -text -framework/I18N/TI18NControl.php -text -framework/I18N/TNumberFormat.php -text -framework/I18N/TTranslate.php -text -framework/I18N/TTranslateParameter.php -text -framework/I18N/Translation.php -text -framework/I18N/core/ChoiceFormat.php -text -framework/I18N/core/CultureInfo.php -text -framework/I18N/core/DateFormat.php -text -framework/I18N/core/DateTimeFormatInfo.php -text -framework/I18N/core/Gettext/MO.php -text -framework/I18N/core/Gettext/PO.php -text -framework/I18N/core/Gettext/TGettext.php -text -framework/I18N/core/HTTPNegotiator.php -text -framework/I18N/core/IMessageSource.php -text -framework/I18N/core/MessageCache.php -text -framework/I18N/core/MessageFormat.php -text -framework/I18N/core/MessageSource.php -text -framework/I18N/core/MessageSource_Database.php -text -framework/I18N/core/MessageSource_MySQL.php -text -framework/I18N/core/MessageSource_SQLite.php -text -framework/I18N/core/MessageSource_XLIFF.php -text -framework/I18N/core/MessageSource_gettext.php -text -framework/I18N/core/NumberFormat.php -text -framework/I18N/core/NumberFormatInfo.php -text -framework/I18N/core/TCache_Lite.php -text framework/I18N/core/data/af.dat -text framework/I18N/core/data/af_ZA.dat -text framework/I18N/core/data/am.dat -text @@ -3378,71 +2638,25 @@ framework/I18N/core/data/zh_Hant_TW.dat -text framework/I18N/core/data/zh_MO.dat -text framework/I18N/core/data/zh_SG.dat -text framework/I18N/core/data/zh_TW.dat -text -framework/I18N/core/util.php -text framework/I18N/schema/mysql.sql -text framework/I18N/schema/postgresql.sql -text framework/I18N/schema/sqlite.sql -text -framework/IO/TTarFileExtractor.php -text -framework/IO/TTextWriter.php -text -framework/PradoBase.php -text -framework/Security/IUserManager.php -text -framework/Security/TAuthManager.php -text -framework/Security/TAuthorizationRule.php -text -framework/Security/TDbUserManager.php -text -framework/Security/TSecurityManager.php -text -framework/Security/TUser.php -text -framework/Security/TUserManager.php -text -framework/TApplication.php -text -framework/TApplicationComponent.php -text -framework/TComponent.php -text -framework/TModule.php -text -framework/TService.php -text -framework/TShellApplication.php -text -framework/Util/TDataFieldAccessor.php -text -framework/Util/TDateTimeStamp.php -text -framework/Util/TLogRouter.php -text -framework/Util/TLogger.php -text -framework/Util/TParameterModule.php -text -framework/Util/TRpcClient.php -text -framework/Util/TSimpleDateFormatter.php -text -framework/Util/TVarDumper.php -text -framework/Web/Javascripts/JSMin.php -text -framework/Web/Javascripts/TJavaScript.php -text -framework/Web/Javascripts/packages.php -text framework/Web/Javascripts/source/.htaccess -text -framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js -text -framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js -text -framework/Web/Javascripts/source/prado/activecontrols/ajax3.js -text -framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js -text -framework/Web/Javascripts/source/prado/activecontrols/dragdropextra.js -text -framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js -text -framework/Web/Javascripts/source/prado/activecontrols/json2.js -text framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html -text framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png -text svneol=unset#image/png framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png -text svneol=unset#image/png framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif -text -framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js -text framework/Web/Javascripts/source/prado/colorpicker/background.png -text framework/Web/Javascripts/source/prado/colorpicker/button.gif -text -framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js -text framework/Web/Javascripts/source/prado/colorpicker/default.css -text framework/Web/Javascripts/source/prado/colorpicker/hue.gif -text framework/Web/Javascripts/source/prado/colorpicker/slider.gif -text framework/Web/Javascripts/source/prado/colorpicker/spacer.gif -text framework/Web/Javascripts/source/prado/colorpicker/target_black.gif -text framework/Web/Javascripts/source/prado/colorpicker/target_white.gif -text -framework/Web/Javascripts/source/prado/controls/accordion.js -text -framework/Web/Javascripts/source/prado/controls/controls.js -text -framework/Web/Javascripts/source/prado/controls/htmlarea.js -text -framework/Web/Javascripts/source/prado/controls/keyboard.js -text -framework/Web/Javascripts/source/prado/controls/slider.js -text -framework/Web/Javascripts/source/prado/controls/tabpanel.js -text framework/Web/Javascripts/source/prado/datepicker/calendar.png -text -framework/Web/Javascripts/source/prado/datepicker/datepicker.js -text framework/Web/Javascripts/source/prado/datepicker/default.css -text framework/Web/Javascripts/source/prado/datepicker/spacer.gif -text -framework/Web/Javascripts/source/prado/logger/logger.js -text -framework/Web/Javascripts/source/prado/prado.js -text framework/Web/Javascripts/source/prado/ratings/blocks.css -text framework/Web/Javascripts/source/prado/ratings/blocks.png -text framework/Web/Javascripts/source/prado/ratings/blocks_blank.gif -text @@ -3454,196 +2668,20 @@ framework/Web/Javascripts/source/prado/ratings/default_blank.gif -text framework/Web/Javascripts/source/prado/ratings/default_half.gif -text framework/Web/Javascripts/source/prado/ratings/default_hover.gif -text framework/Web/Javascripts/source/prado/ratings/default_selected.gif -text -framework/Web/Javascripts/source/prado/ratings/ratings.js -text framework/Web/Javascripts/source/prado/ratings/stars1.png -text -framework/Web/Javascripts/source/prado/scriptaculous-adapter.js -text -framework/Web/Javascripts/source/prado/validator/validation3.js -text -framework/Web/Javascripts/source/prototype-1.7/prototype.js -text framework/Web/Javascripts/source/scriptaculous-1.9.0/CHANGELOG -text framework/Web/Javascripts/source/scriptaculous-1.9.0/MIT-LICENSE -text -framework/Web/Javascripts/source/scriptaculous-1.9.0/builder.js -text -framework/Web/Javascripts/source/scriptaculous-1.9.0/controls.js -text -framework/Web/Javascripts/source/scriptaculous-1.9.0/dragdrop.js -text -framework/Web/Javascripts/source/scriptaculous-1.9.0/effects.js -text -framework/Web/Javascripts/source/scriptaculous-1.9.0/scriptaculous.js -text -framework/Web/Javascripts/source/scriptaculous-1.9.0/slider.js -text -framework/Web/Javascripts/source/scriptaculous-1.9.0/sound.js -text -framework/Web/Services/TFeedService.php -text -framework/Web/Services/TJsonService.php -text -framework/Web/Services/TPageService.php -text -framework/Web/Services/TRpcService.php -text -framework/Web/Services/TSoapService.php -text -framework/Web/TAssetManager.php -text -framework/Web/TCacheHttpSession.php -text -framework/Web/THttpRequest.php -text -framework/Web/THttpResponse.php -text -framework/Web/THttpSession.php -text -framework/Web/THttpUtility.php -text -framework/Web/TUrlManager.php -text -framework/Web/TUrlMapping.php -text -framework/Web/UI/ActiveControls/TActiveButton.php -text -framework/Web/UI/ActiveControls/TActiveClientScript.php -text -framework/Web/UI/ActiveControls/TActiveControlAdapter.php -text -framework/Web/UI/ActiveControls/TActiveCustomValidator.php -text -framework/Web/UI/ActiveControls/TActiveDataGrid.php -text -framework/Web/UI/ActiveControls/TActiveDataList.php -text -framework/Web/UI/ActiveControls/TActiveHiddenField.php -text -framework/Web/UI/ActiveControls/TActiveLabel.php -text -framework/Web/UI/ActiveControls/TActiveMultiView.php -text -framework/Web/UI/ActiveControls/TActivePageAdapter.php -text -framework/Web/UI/ActiveControls/TActivePager.php -text -framework/Web/UI/ActiveControls/TActivePanel.php -text -framework/Web/UI/ActiveControls/TActiveRatingList.php -text -framework/Web/UI/ActiveControls/TActiveRepeater.php -text -framework/Web/UI/ActiveControls/TActiveTableCell.php -text -framework/Web/UI/ActiveControls/TActiveTableRow.php -text -framework/Web/UI/ActiveControls/TActiveTextBox.php -text -framework/Web/UI/ActiveControls/TAutoComplete.php -text -framework/Web/UI/ActiveControls/TBaseActiveControl.php -text -framework/Web/UI/ActiveControls/TCallback.php -text -framework/Web/UI/ActiveControls/TCallbackClientScript.php -text -framework/Web/UI/ActiveControls/TCallbackClientSide.php -text -framework/Web/UI/ActiveControls/TCallbackEventParameter.php -text -framework/Web/UI/ActiveControls/TCallbackOptions.php -text -framework/Web/UI/ActiveControls/TEventTriggeredCallback.php -text -framework/Web/UI/ActiveControls/TInPlaceTextBox.php -text -framework/Web/UI/ActiveControls/TTriggeredCallback.php -text -framework/Web/UI/ActiveControls/TValueTriggeredCallback.php -text -framework/Web/UI/TCachePageStatePersister.php -text -framework/Web/UI/TClientScriptManager.php -text -framework/Web/UI/TCompositeControl.php -text -framework/Web/UI/TControl.php -text -framework/Web/UI/TControlAdapter.php -text -framework/Web/UI/TForm.php -text -framework/Web/UI/THtmlWriter.php -text -framework/Web/UI/TPage.php -text -framework/Web/UI/TPageStatePersister.php -text -framework/Web/UI/TSessionPageStatePersister.php -text -framework/Web/UI/TTemplateControl.php -text -framework/Web/UI/TTemplateControlInheritable.php -text -framework/Web/UI/TTemplateManager.php -text -framework/Web/UI/TThemeManager.php -text -framework/Web/UI/WebControls/TAccordion.php -text -framework/Web/UI/WebControls/TBaseDataList.php -text -framework/Web/UI/WebControls/TBaseValidator.php -text -framework/Web/UI/WebControls/TBoundColumn.php -text -framework/Web/UI/WebControls/TBulletedList.php -text -framework/Web/UI/WebControls/TButton.php -text -framework/Web/UI/WebControls/TButtonColumn.php -text -framework/Web/UI/WebControls/TCaptcha.php -text -framework/Web/UI/WebControls/TCaptchaValidator.php -text -framework/Web/UI/WebControls/TCheckBox.php -text -framework/Web/UI/WebControls/TCheckBoxColumn.php -text -framework/Web/UI/WebControls/TCheckBoxList.php -text -framework/Web/UI/WebControls/TClientScript.php -text -framework/Web/UI/WebControls/TColorPicker.php -text -framework/Web/UI/WebControls/TCompareValidator.php -text -framework/Web/UI/WebControls/TConditional.php -text -framework/Web/UI/WebControls/TContent.php -text -framework/Web/UI/WebControls/TContentPlaceHolder.php -text -framework/Web/UI/WebControls/TCustomValidator.php -text -framework/Web/UI/WebControls/TDataBoundControl.php -text -framework/Web/UI/WebControls/TDataGrid.php -text -framework/Web/UI/WebControls/TDataGridColumn.php -text -framework/Web/UI/WebControls/TDataGridItemRenderer.php -text -framework/Web/UI/WebControls/TDataGridPagerStyle.php -text -framework/Web/UI/WebControls/TDataList.php -text -framework/Web/UI/WebControls/TDataListItemRenderer.php -text -framework/Web/UI/WebControls/TDataRenderer.php -text -framework/Web/UI/WebControls/TDataSourceControl.php -text -framework/Web/UI/WebControls/TDataSourceView.php -text -framework/Web/UI/WebControls/TDataTypeValidator.php -text -framework/Web/UI/WebControls/TDatePicker.php -text -framework/Web/UI/WebControls/TDropDownList.php -text -framework/Web/UI/WebControls/TDropDownListColumn.php -text -framework/Web/UI/WebControls/TEditCommandColumn.php -text -framework/Web/UI/WebControls/TEmailAddressValidator.php -text -framework/Web/UI/WebControls/TExpression.php -text -framework/Web/UI/WebControls/TFileUpload.php -text -framework/Web/UI/WebControls/TFlushOutput.php -text -framework/Web/UI/WebControls/TFont.php -text -framework/Web/UI/WebControls/THead.php -text -framework/Web/UI/WebControls/THeader1.php -text -framework/Web/UI/WebControls/THeader2.php -text -framework/Web/UI/WebControls/THeader3.php -text -framework/Web/UI/WebControls/THeader4.php -text -framework/Web/UI/WebControls/THeader5.php -text -framework/Web/UI/WebControls/THeader6.php -text -framework/Web/UI/WebControls/THiddenField.php -text -framework/Web/UI/WebControls/THtmlArea.php -text -framework/Web/UI/WebControls/THtmlElement.php -text -framework/Web/UI/WebControls/THyperLink.php -text -framework/Web/UI/WebControls/THyperLinkColumn.php -text -framework/Web/UI/WebControls/TImage.php -text -framework/Web/UI/WebControls/TImageButton.php -text -framework/Web/UI/WebControls/TImageMap.php -text -framework/Web/UI/WebControls/TInlineFrame.php -text -framework/Web/UI/WebControls/TItemDataRenderer.php -text -framework/Web/UI/WebControls/TJavascriptLogger.php -text -framework/Web/UI/WebControls/TKeyboard.php -text -framework/Web/UI/WebControls/TLabel.php -text -framework/Web/UI/WebControls/TLinkButton.php -text -framework/Web/UI/WebControls/TListBox.php -text -framework/Web/UI/WebControls/TListControl.php -text -framework/Web/UI/WebControls/TListControlValidator.php -text -framework/Web/UI/WebControls/TListItem.php -text -framework/Web/UI/WebControls/TLiteral.php -text -framework/Web/UI/WebControls/TLiteralColumn.php -text -framework/Web/UI/WebControls/TMarkdown.php -text -framework/Web/UI/WebControls/TMultiView.php -text -framework/Web/UI/WebControls/TOutputCache.php -text -framework/Web/UI/WebControls/TPager.php -text -framework/Web/UI/WebControls/TPanel.php -text -framework/Web/UI/WebControls/TPanelStyle.php -text -framework/Web/UI/WebControls/TPlaceHolder.php -text -framework/Web/UI/WebControls/TRadioButton.php -text -framework/Web/UI/WebControls/TRadioButtonList.php -text -framework/Web/UI/WebControls/TRangeValidator.php -text -framework/Web/UI/WebControls/TRatingList.php -text -framework/Web/UI/WebControls/TReCaptcha.php -text -framework/Web/UI/WebControls/TReCaptchaValidator.php -text -framework/Web/UI/WebControls/TRegularExpressionValidator.php -text -framework/Web/UI/WebControls/TRepeatInfo.php -text -framework/Web/UI/WebControls/TRepeater.php -text -framework/Web/UI/WebControls/TRepeaterItemRenderer.php -text -framework/Web/UI/WebControls/TRequiredFieldValidator.php -text -framework/Web/UI/WebControls/TSafeHtml.php -text -framework/Web/UI/WebControls/TSlider.php -text -framework/Web/UI/WebControls/TStatements.php -text -framework/Web/UI/WebControls/TStyle.php -text -framework/Web/UI/WebControls/TTabPanel.php -text -framework/Web/UI/WebControls/TTable.php -text -framework/Web/UI/WebControls/TTableCell.php -text -framework/Web/UI/WebControls/TTableFooterRow.php -text -framework/Web/UI/WebControls/TTableHeaderCell.php -text -framework/Web/UI/WebControls/TTableHeaderRow.php -text -framework/Web/UI/WebControls/TTableRow.php -text -framework/Web/UI/WebControls/TTemplateColumn.php -text -framework/Web/UI/WebControls/TTextBox.php -text -framework/Web/UI/WebControls/TTextHighlighter.php -text -framework/Web/UI/WebControls/TTextProcessor.php -text -framework/Web/UI/WebControls/TValidationSummary.php -text -framework/Web/UI/WebControls/TWebControl.php -text -framework/Web/UI/WebControls/TWebControlAdapter.php -text -framework/Web/UI/WebControls/TWebControlDecorator.php -text -framework/Web/UI/WebControls/TWizard.php -text -framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php -text -framework/Web/UI/WebControls/TXmlTransform.php -text framework/Web/UI/WebControls/assets/TSlider/TSlider.css -text framework/Web/UI/WebControls/assets/TSlider/TSliderHandleHorizontal.png -text framework/Web/UI/WebControls/assets/TSlider/TSliderHandleVertical.png -text framework/Web/UI/WebControls/assets/accordion.css -text -framework/Web/UI/WebControls/assets/captcha.php -text framework/Web/UI/WebControls/assets/keyboard.css -text framework/Web/UI/WebControls/assets/tabpanel.css -text framework/Web/UI/WebControls/assets/verase.ttf -text -framework/Xml/TXmlDocument.php -text -framework/interfaces.php -text framework/powered.gif -text framework/powered2.gif -text framework/prado-cli -text framework/prado-cli.bat -text -framework/prado.php -text /index.html -text /phing -text /phing.bat -text diff --git a/buildscripts/Benchmark/Iterate.php b/buildscripts/Benchmark/Iterate.php index acf1ec08..f09dcb76 100644 --- a/buildscripts/Benchmark/Iterate.php +++ b/buildscripts/Benchmark/Iterate.php @@ -1,167 +1,167 @@ -. | -// +------------------------------------------------------------------------+ -// | This source file is subject to the New BSD license, That is bundled | -// | with this package in the file LICENSE, and is available through | -// | the world-wide-web at | -// | http://www.opensource.org/licenses/bsd-license.php | -// | If you did not receive a copy of the new BSDlicense and are unable | -// | to obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +------------------------------------------------------------------------+ -// -// $Id: Iterate.php,v 1.12 2006/02/17 16:29:44 toggg Exp $ -// - -require_once 'Benchmark/Timer.php'; - -/** - * Provides timing and profiling information. - * - * Example 1 - * - * - * '; - * } - * - * $benchmark->run(100, 'foo', 'test'); - * $result = $benchmark->get(); - * ?> - * - * - * Example 2 - * - * - * '; - * } - * } - * - * $benchmark->run(100, 'myclass::foo', 'test'); - * $result = $benchmark->get(); - * ?> - * - * - * Example 3 - * - * - * '; - * } - * } - * - * $o = new MyClass(); - * - * $benchmark->run(100, 'o->foo', 'test'); - * $result = $benchmark->get(); - * ?> - * - * - * @author Sebastian Bergmann - * @copyright Copyright © 2002-2005 Sebastian Bergmann - * @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0 - * @category Benchmarking - * @package Benchmark - */ -class Benchmark_Iterate extends Benchmark_Timer { - /** - * Benchmarks a function or method. - * - * @access public - */ - function run() { - $arguments = func_get_args(); - $iterations = array_shift($arguments); - $function_name = array_shift($arguments); - - if (strstr($function_name, '::')) { - $function_name = explode('::', $function_name); - $objectmethod = $function_name[1]; - } - - if (strstr($function_name, '->')) { - $function_name = explode('->', $function_name); - $objectname = $function_name[0]; - - $object = $GLOBALS[$objectname]; - $objectmethod = $function_name[1]; - - for ($i = 1; $i <= $iterations; $i++) { - $this->setMarker('start_' . $i); - call_user_func_array(array($object, $function_name[1]), $arguments); - $this->setMarker('end_' . $i); - } - - return(0); - } - - for ($i = 1; $i <= $iterations; $i++) { - $this->setMarker('start_' . $i); - call_user_func_array($function_name, $arguments); - $this->setMarker('end_' . $i); - } - } - - /** - * Returns benchmark result. - * - * $result[x ] = execution time of iteration x - * $result['mean' ] = mean execution time - * $result['iterations'] = number of iterations - * - * @return array - * @access public - */ - function get($simple_output = false) { - $result = array(); - $total = 0; - - $iterations = count($this->markers)/2; - - for ($i = 1; $i <= $iterations; $i++) { - $time = $this->timeElapsed('start_'.$i , 'end_'.$i); - - if (extension_loaded('bcmath')) { - $total = bcadd($total, $time, 6); - } else { - $total = $total + $time; - } - - if (!$simple_output) { - $result[$i] = $time; - } - } - - if (extension_loaded('bcmath')) { - $result['mean'] = bcdiv($total, $iterations, 6); - } else { - $result['mean'] = $total / $iterations; - } - - $result['iterations'] = $iterations; - - return $result; - } -} +. | +// +------------------------------------------------------------------------+ +// | This source file is subject to the New BSD license, That is bundled | +// | with this package in the file LICENSE, and is available through | +// | the world-wide-web at | +// | http://www.opensource.org/licenses/bsd-license.php | +// | If you did not receive a copy of the new BSDlicense and are unable | +// | to obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +------------------------------------------------------------------------+ +// +// $Id: Iterate.php,v 1.12 2006/02/17 16:29:44 toggg Exp $ +// + +require_once 'Benchmark/Timer.php'; + +/** + * Provides timing and profiling information. + * + * Example 1 + * + * + * '; + * } + * + * $benchmark->run(100, 'foo', 'test'); + * $result = $benchmark->get(); + * ?> + * + * + * Example 2 + * + * + * '; + * } + * } + * + * $benchmark->run(100, 'myclass::foo', 'test'); + * $result = $benchmark->get(); + * ?> + * + * + * Example 3 + * + * + * '; + * } + * } + * + * $o = new MyClass(); + * + * $benchmark->run(100, 'o->foo', 'test'); + * $result = $benchmark->get(); + * ?> + * + * + * @author Sebastian Bergmann + * @copyright Copyright © 2002-2005 Sebastian Bergmann + * @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0 + * @category Benchmarking + * @package Benchmark + */ +class Benchmark_Iterate extends Benchmark_Timer { + /** + * Benchmarks a function or method. + * + * @access public + */ + function run() { + $arguments = func_get_args(); + $iterations = array_shift($arguments); + $function_name = array_shift($arguments); + + if (strstr($function_name, '::')) { + $function_name = explode('::', $function_name); + $objectmethod = $function_name[1]; + } + + if (strstr($function_name, '->')) { + $function_name = explode('->', $function_name); + $objectname = $function_name[0]; + + $object = $GLOBALS[$objectname]; + $objectmethod = $function_name[1]; + + for ($i = 1; $i <= $iterations; $i++) { + $this->setMarker('start_' . $i); + call_user_func_array(array($object, $function_name[1]), $arguments); + $this->setMarker('end_' . $i); + } + + return(0); + } + + for ($i = 1; $i <= $iterations; $i++) { + $this->setMarker('start_' . $i); + call_user_func_array($function_name, $arguments); + $this->setMarker('end_' . $i); + } + } + + /** + * Returns benchmark result. + * + * $result[x ] = execution time of iteration x + * $result['mean' ] = mean execution time + * $result['iterations'] = number of iterations + * + * @return array + * @access public + */ + function get($simple_output = false) { + $result = array(); + $total = 0; + + $iterations = count($this->markers)/2; + + for ($i = 1; $i <= $iterations; $i++) { + $time = $this->timeElapsed('start_'.$i , 'end_'.$i); + + if (extension_loaded('bcmath')) { + $total = bcadd($total, $time, 6); + } else { + $total = $total + $time; + } + + if (!$simple_output) { + $result[$i] = $time; + } + } + + if (extension_loaded('bcmath')) { + $result['mean'] = bcdiv($total, $iterations, 6); + } else { + $result['mean'] = $total / $iterations; + } + + $result['iterations'] = $iterations; + + return $result; + } +} diff --git a/buildscripts/Benchmark/Profiler.php b/buildscripts/Benchmark/Profiler.php index e9108a84..001f1959 100644 --- a/buildscripts/Benchmark/Profiler.php +++ b/buildscripts/Benchmark/Profiler.php @@ -1,447 +1,447 @@ -. | -// +----------------------------------------------------------------------+ -// | This source file is subject to the New BSD license, That is bundled | -// | with this package in the file LICENSE, and is available through | -// | the world-wide-web at | -// | http://www.opensource.org/licenses/bsd-license.php | -// | If you did not receive a copy of the new BSDlicense and are unable | -// | to obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// -// $Id: Profiler.php,v 1.19 2006/03/01 19:26:09 anant Exp $ -// - -require_once 'PEAR.php'; - -/** - * Provides timing and profiling information. - * - * Example 1: Automatic profiling start, stop, and output. - * - * - * enterSection('myFunction'); - * //do something - * $profiler->leaveSection('myFunction'); - * return; - * } - * - * //do something - * myFunction(); - * //do more - * ?> - * - * - * Example 2: Manual profiling start, stop, and output. - * - * - * enterSection('myFunction'); - * //do something - * $profiler->leaveSection('myFunction'); - * return; - * } - * - * $profiler->start(); - * //do something - * myFunction(); - * //do more - * $profiler->stop(); - * $profiler->display(); - * ?> - * - * - * @author Matthias Englert - * @copyright Copyright © 2002-2005 Matthias Englert - * @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0 - * @category Benchmarking - * @package Benchmark - * @since 1.2.0 - */ -class Benchmark_Profiler extends PEAR { - /** - * Contains the total ex. time of each section - * - * @var array - * @access private - */ - var $_sections = array(); - - /** - * Calling stack - * - * @var array - * @access private - */ - var $_stack = array(); - - /** - * Notes how often a section was entered - * - * @var array - * @access private - */ - var $_numberOfCalls = array(); - - /** - * Notes for each section how much time is spend in sub-sections - * - * @var array - * @access private - */ - var $_subSectionsTime = array(); - - /** - * Notes for each section how often it calls which section - * - * @var array - * @access private - */ - var $_calls = array(); - - /** - * Notes for each section how often it was called by which section - * - * @var array - * @access private - */ - var $_callers = array(); - - /** - * Auto-starts and stops profiler - * - * @var boolean - * @access private - */ - var $_auto = FALSE; - - /** - * Max marker name length for non-html output - * - * @var integer - * @access private - */ - var $_maxStringLength = 0; - - /** - * Constructor, starts profiling recording - * - * @access public - */ - function Benchmark_Profiler($auto = FALSE) { - $this->_auto = $auto; - - if ($this->_auto) { - $this->start(); - } - - $this->PEAR(); - } - - /** - * Destructor, stops profiling recording - * - * @access private - */ - function _Benchmark_Profiler() { - if (isset($this->_auto) && $this->_auto) { - $this->stop(); - $this->display(); - } - } - - /** - * Returns profiling informations for a given section. - * - * @param string $section - * @return array - * @access public - */ - function getSectionInformations($section = 'Global') { - if (isset($this->_sections[$section])) { - $calls = array(); - - if (isset($this->_calls[$section])) { - $calls = $this->_calls[$section]; - } - - $callers = array(); - - if (isset($this->_callers[$section])) { - $callers = $this->_callers[$section]; - } - - $informations = array(); - - $informations['time'] = $this->_sections[$section]; - if (isset($this->_sections['Global'])) { - $informations['percentage'] = number_format(100 * $this->_sections[$section] / $this->_sections['Global'], 2, '.', ''); - } else { - $informations['percentage'] = 'N/A'; - } - $informations['calls'] = $calls; - $informations['num_calls'] = $this->_numberOfCalls[$section]; - $informations['callers'] = $callers; - - if (isset($this->_subSectionsTime[$section])) { - $informations['netto_time'] = $this->_sections[$section] - $this->_subSectionsTime[$section]; - } else { - $informations['netto_time'] = $this->_sections[$section]; - } - - return $informations; - } else { - $this->raiseError("The section '$section' does not exists.\n", NULL, PEAR_ERROR_TRIGGER, E_USER_WARNING); - } - } - - /** - * Returns profiling informations for all sections. - * - * @return array - * @access public - */ - function getAllSectionsInformations() { - $informations = array(); - - foreach($this->_sections as $section => $time) { - $informations[$section] = $this->getSectionInformations($section); - } - - return $informations; - } - - /** - * Returns formatted profiling information. - * - * @param string output format (auto, plain or html), default auto - * @see display() - * @access private - */ - function _getOutput($format) { - - /* Quickly find out the maximun length: Ineffecient, but will do for now! */ - $informations = $this->getAllSectionsInformations(); - $names = array_keys($informations); - - $maxLength = 0; - foreach ($names as $name) - { - if ($maxLength < strlen($name)) { - $maxLength = strlen($name); - } - } - $this->_maxStringLength = $maxLength; - - if ($format == 'auto') { - if (function_exists('version_compare') && - version_compare(phpversion(), '4.1', 'ge')) { - $format = isset($_SERVER['SERVER_PROTOCOL']) ? 'html' : 'plain'; - } else { - global $HTTP_SERVER_VARS; - $format = isset($HTTP_SERVER_VARS['SERVER_PROTOCOL']) ? 'html' : 'plain'; - } - } - - if ($format == 'html') { - $out = ''."\n"; - $out .= - ''. - ''. - ''. - ''. - "\n"; - } else { - $dashes = $out = str_pad("\n", ($this->_maxStringLength + 75), '-', STR_PAD_LEFT); - $out .= str_pad('Section', $this->_maxStringLength + 10); - $out .= str_pad("Total Ex Time", 22); - $out .= str_pad("Netto Ex Time", 22); - $out .= str_pad("#Calls", 10); - $out .= "Percentage\n"; - $out .= $dashes; - } - - foreach($informations as $name => $values) { - $percentage = $values['percentage']; - $calls_str = ""; - - foreach($values['calls'] as $key => $val) { - if ($calls_str) { - $calls_str .= ", "; - } - - $calls_str .= "$key ($val)"; - } - - $callers_str = ""; - - foreach($values['callers'] as $key => $val) { - if ($callers_str) { - $callers_str .= ", "; - } - - $callers_str .= "$key ($val)"; - } - - if ($format == 'html') { - $out .= ""; - if (is_numeric($values['percentage'])) { - $out .= "\n"; - } else { - $out .= "\n"; - } - $out .= ""; - } else { - $out .= str_pad($name, $this->_maxStringLength + 10); - $out .= str_pad($values['time'], 22); - $out .= str_pad($values['netto_time'], 22); - $out .= str_pad($values['num_calls'], 10); - if (is_numeric($values['percentage'])) { - $out .= str_pad($values['percentage']."%\n", 8, ' ', STR_PAD_LEFT); - } else { - $out .= str_pad($values['percentage']."\n", 8, ' ', STR_PAD_LEFT); - } - } - } - - if ($format == 'html') { - return $out . '
 total ex. timenetto ex. time#calls%callscallers
$name{$values['time']}{$values['netto_time']}{$values['num_calls']}{$values['percentage']}%{$values['percentage']}$calls_str$callers_str
'; - } else { - return $out; - } - } - - /** - * Returns formatted profiling information. - * - * @param string output format (auto, plain or html), default auto - * @access public - */ - function display($format = 'auto') { - echo $this->_getOutput($format); - } - - /** - * Enters "Global" section. - * - * @see enterSection(), stop() - * @access public - */ - function start() { - $this->enterSection('Global'); - } - - /** - * Leaves "Global" section. - * - * @see leaveSection(), start() - * @access public - */ - function stop() { - $this->leaveSection('Global'); - } - - /** - * Enters code section. - * - * @param string name of the code section - * @see start(), leaveSection() - * @access public - */ - function enterSection($name) { - if (count($this->_stack)) { - if (isset($this->_callers[$name][$this->_stack[count($this->_stack) - 1]["name"]])) { - $this->_callers[$name][$this->_stack[count($this->_stack) - 1]["name"]]++; - } else { - $this->_callers[$name][$this->_stack[count($this->_stack) - 1]["name"]] = 1; - } - - if (isset($this->_calls[$this->_stack[count($this->_stack) - 1]["name"]][$name])) { - $this->_calls[$this->_stack[count($this->_stack) - 1]["name"]][$name]++; - } else { - $this->_calls[$this->_stack[count($this->_stack) - 1]["name"]][$name] = 1; - } - } else { - if ($name != 'Global') { - $this->raiseError("tried to enter section ".$name." but profiling was not started\n", NULL, PEAR_ERROR_DIE); - } - } - - if (isset($this->_numberOfCalls[$name])) { - $this->_numberOfCalls[$name]++; - } else { - $this->_numberOfCalls[$name] = 1; - } - - array_push($this->_stack, array("name" => $name, "time" => $this->_getMicrotime())); - } - - /** - * Leaves code section. - * - * @param string name of the marker to be set - * @see stop(), enterSection() - * @access public - */ - function leaveSection($name) { - $microtime = $this->_getMicrotime(); - - if (!count($this->_stack)) { - $this->raiseError("tried to leave section ".$name." but profiling was not started\n", NULL, PEAR_ERROR_DIE); - } - - $x = array_pop($this->_stack); - - if ($x["name"] != $name) { - $this->raiseError("reached end of section $name but expecting end of " . $x["name"]."\n", NULL, PEAR_ERROR_DIE); - } - - if (isset($this->_sections[$name])) { - $this->_sections[$name] += $microtime - $x["time"]; - } else { - $this->_sections[$name] = $microtime - $x["time"]; - } - - $parent = array_pop($this->_stack); - - if (isset($parent)) { - if (isset($this->_subSectionsTime[$parent['name']])) { - $this->_subSectionsTime[$parent['name']] += $microtime - $x['time']; - } else { - $this->_subSectionsTime[$parent['name']] = $microtime - $x['time']; - } - - array_push($this->_stack, $parent); - } - } - - /** - * Wrapper for microtime(). - * - * @return float - * @access private - * @since 1.3.0 - */ - function _getMicrotime() { - $microtime = explode(' ', microtime()); - return $microtime[1] . substr($microtime[0], 1); - } -} +. | +// +----------------------------------------------------------------------+ +// | This source file is subject to the New BSD license, That is bundled | +// | with this package in the file LICENSE, and is available through | +// | the world-wide-web at | +// | http://www.opensource.org/licenses/bsd-license.php | +// | If you did not receive a copy of the new BSDlicense and are unable | +// | to obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// +// $Id: Profiler.php,v 1.19 2006/03/01 19:26:09 anant Exp $ +// + +require_once 'PEAR.php'; + +/** + * Provides timing and profiling information. + * + * Example 1: Automatic profiling start, stop, and output. + * + * + * enterSection('myFunction'); + * //do something + * $profiler->leaveSection('myFunction'); + * return; + * } + * + * //do something + * myFunction(); + * //do more + * ?> + * + * + * Example 2: Manual profiling start, stop, and output. + * + * + * enterSection('myFunction'); + * //do something + * $profiler->leaveSection('myFunction'); + * return; + * } + * + * $profiler->start(); + * //do something + * myFunction(); + * //do more + * $profiler->stop(); + * $profiler->display(); + * ?> + * + * + * @author Matthias Englert + * @copyright Copyright © 2002-2005 Matthias Englert + * @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0 + * @category Benchmarking + * @package Benchmark + * @since 1.2.0 + */ +class Benchmark_Profiler extends PEAR { + /** + * Contains the total ex. time of each section + * + * @var array + * @access private + */ + var $_sections = array(); + + /** + * Calling stack + * + * @var array + * @access private + */ + var $_stack = array(); + + /** + * Notes how often a section was entered + * + * @var array + * @access private + */ + var $_numberOfCalls = array(); + + /** + * Notes for each section how much time is spend in sub-sections + * + * @var array + * @access private + */ + var $_subSectionsTime = array(); + + /** + * Notes for each section how often it calls which section + * + * @var array + * @access private + */ + var $_calls = array(); + + /** + * Notes for each section how often it was called by which section + * + * @var array + * @access private + */ + var $_callers = array(); + + /** + * Auto-starts and stops profiler + * + * @var boolean + * @access private + */ + var $_auto = FALSE; + + /** + * Max marker name length for non-html output + * + * @var integer + * @access private + */ + var $_maxStringLength = 0; + + /** + * Constructor, starts profiling recording + * + * @access public + */ + function Benchmark_Profiler($auto = FALSE) { + $this->_auto = $auto; + + if ($this->_auto) { + $this->start(); + } + + $this->PEAR(); + } + + /** + * Destructor, stops profiling recording + * + * @access private + */ + function _Benchmark_Profiler() { + if (isset($this->_auto) && $this->_auto) { + $this->stop(); + $this->display(); + } + } + + /** + * Returns profiling informations for a given section. + * + * @param string $section + * @return array + * @access public + */ + function getSectionInformations($section = 'Global') { + if (isset($this->_sections[$section])) { + $calls = array(); + + if (isset($this->_calls[$section])) { + $calls = $this->_calls[$section]; + } + + $callers = array(); + + if (isset($this->_callers[$section])) { + $callers = $this->_callers[$section]; + } + + $informations = array(); + + $informations['time'] = $this->_sections[$section]; + if (isset($this->_sections['Global'])) { + $informations['percentage'] = number_format(100 * $this->_sections[$section] / $this->_sections['Global'], 2, '.', ''); + } else { + $informations['percentage'] = 'N/A'; + } + $informations['calls'] = $calls; + $informations['num_calls'] = $this->_numberOfCalls[$section]; + $informations['callers'] = $callers; + + if (isset($this->_subSectionsTime[$section])) { + $informations['netto_time'] = $this->_sections[$section] - $this->_subSectionsTime[$section]; + } else { + $informations['netto_time'] = $this->_sections[$section]; + } + + return $informations; + } else { + $this->raiseError("The section '$section' does not exists.\n", NULL, PEAR_ERROR_TRIGGER, E_USER_WARNING); + } + } + + /** + * Returns profiling informations for all sections. + * + * @return array + * @access public + */ + function getAllSectionsInformations() { + $informations = array(); + + foreach($this->_sections as $section => $time) { + $informations[$section] = $this->getSectionInformations($section); + } + + return $informations; + } + + /** + * Returns formatted profiling information. + * + * @param string output format (auto, plain or html), default auto + * @see display() + * @access private + */ + function _getOutput($format) { + + /* Quickly find out the maximun length: Ineffecient, but will do for now! */ + $informations = $this->getAllSectionsInformations(); + $names = array_keys($informations); + + $maxLength = 0; + foreach ($names as $name) + { + if ($maxLength < strlen($name)) { + $maxLength = strlen($name); + } + } + $this->_maxStringLength = $maxLength; + + if ($format == 'auto') { + if (function_exists('version_compare') && + version_compare(phpversion(), '4.1', 'ge')) { + $format = isset($_SERVER['SERVER_PROTOCOL']) ? 'html' : 'plain'; + } else { + global $HTTP_SERVER_VARS; + $format = isset($HTTP_SERVER_VARS['SERVER_PROTOCOL']) ? 'html' : 'plain'; + } + } + + if ($format == 'html') { + $out = ''."\n"; + $out .= + ''. + ''. + ''. + ''. + "\n"; + } else { + $dashes = $out = str_pad("\n", ($this->_maxStringLength + 75), '-', STR_PAD_LEFT); + $out .= str_pad('Section', $this->_maxStringLength + 10); + $out .= str_pad("Total Ex Time", 22); + $out .= str_pad("Netto Ex Time", 22); + $out .= str_pad("#Calls", 10); + $out .= "Percentage\n"; + $out .= $dashes; + } + + foreach($informations as $name => $values) { + $percentage = $values['percentage']; + $calls_str = ""; + + foreach($values['calls'] as $key => $val) { + if ($calls_str) { + $calls_str .= ", "; + } + + $calls_str .= "$key ($val)"; + } + + $callers_str = ""; + + foreach($values['callers'] as $key => $val) { + if ($callers_str) { + $callers_str .= ", "; + } + + $callers_str .= "$key ($val)"; + } + + if ($format == 'html') { + $out .= ""; + if (is_numeric($values['percentage'])) { + $out .= "\n"; + } else { + $out .= "\n"; + } + $out .= ""; + } else { + $out .= str_pad($name, $this->_maxStringLength + 10); + $out .= str_pad($values['time'], 22); + $out .= str_pad($values['netto_time'], 22); + $out .= str_pad($values['num_calls'], 10); + if (is_numeric($values['percentage'])) { + $out .= str_pad($values['percentage']."%\n", 8, ' ', STR_PAD_LEFT); + } else { + $out .= str_pad($values['percentage']."\n", 8, ' ', STR_PAD_LEFT); + } + } + } + + if ($format == 'html') { + return $out . '
 total ex. timenetto ex. time#calls%callscallers
$name{$values['time']}{$values['netto_time']}{$values['num_calls']}{$values['percentage']}%{$values['percentage']}$calls_str$callers_str
'; + } else { + return $out; + } + } + + /** + * Returns formatted profiling information. + * + * @param string output format (auto, plain or html), default auto + * @access public + */ + function display($format = 'auto') { + echo $this->_getOutput($format); + } + + /** + * Enters "Global" section. + * + * @see enterSection(), stop() + * @access public + */ + function start() { + $this->enterSection('Global'); + } + + /** + * Leaves "Global" section. + * + * @see leaveSection(), start() + * @access public + */ + function stop() { + $this->leaveSection('Global'); + } + + /** + * Enters code section. + * + * @param string name of the code section + * @see start(), leaveSection() + * @access public + */ + function enterSection($name) { + if (count($this->_stack)) { + if (isset($this->_callers[$name][$this->_stack[count($this->_stack) - 1]["name"]])) { + $this->_callers[$name][$this->_stack[count($this->_stack) - 1]["name"]]++; + } else { + $this->_callers[$name][$this->_stack[count($this->_stack) - 1]["name"]] = 1; + } + + if (isset($this->_calls[$this->_stack[count($this->_stack) - 1]["name"]][$name])) { + $this->_calls[$this->_stack[count($this->_stack) - 1]["name"]][$name]++; + } else { + $this->_calls[$this->_stack[count($this->_stack) - 1]["name"]][$name] = 1; + } + } else { + if ($name != 'Global') { + $this->raiseError("tried to enter section ".$name." but profiling was not started\n", NULL, PEAR_ERROR_DIE); + } + } + + if (isset($this->_numberOfCalls[$name])) { + $this->_numberOfCalls[$name]++; + } else { + $this->_numberOfCalls[$name] = 1; + } + + array_push($this->_stack, array("name" => $name, "time" => $this->_getMicrotime())); + } + + /** + * Leaves code section. + * + * @param string name of the marker to be set + * @see stop(), enterSection() + * @access public + */ + function leaveSection($name) { + $microtime = $this->_getMicrotime(); + + if (!count($this->_stack)) { + $this->raiseError("tried to leave section ".$name." but profiling was not started\n", NULL, PEAR_ERROR_DIE); + } + + $x = array_pop($this->_stack); + + if ($x["name"] != $name) { + $this->raiseError("reached end of section $name but expecting end of " . $x["name"]."\n", NULL, PEAR_ERROR_DIE); + } + + if (isset($this->_sections[$name])) { + $this->_sections[$name] += $microtime - $x["time"]; + } else { + $this->_sections[$name] = $microtime - $x["time"]; + } + + $parent = array_pop($this->_stack); + + if (isset($parent)) { + if (isset($this->_subSectionsTime[$parent['name']])) { + $this->_subSectionsTime[$parent['name']] += $microtime - $x['time']; + } else { + $this->_subSectionsTime[$parent['name']] = $microtime - $x['time']; + } + + array_push($this->_stack, $parent); + } + } + + /** + * Wrapper for microtime(). + * + * @return float + * @access private + * @since 1.3.0 + */ + function _getMicrotime() { + $microtime = explode(' ', microtime()); + return $microtime[1] . substr($microtime[0], 1); + } +} diff --git a/buildscripts/Benchmark/Timer.php b/buildscripts/Benchmark/Timer.php index d713e6b2..feee38c2 100644 --- a/buildscripts/Benchmark/Timer.php +++ b/buildscripts/Benchmark/Timer.php @@ -1,319 +1,319 @@ -. | -// +------------------------------------------------------------------------+ -// | This source file is subject to the New BSD license, That is bundled | -// | with this package in the file LICENSE, and is available through | -// | the world-wide-web at | -// | http://www.opensource.org/licenses/bsd-license.php | -// | If you did not receive a copy of the new BSDlicense and are unable | -// | to obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +------------------------------------------------------------------------+ -// -// $Id: Timer.php,v 1.16 2006/03/01 13:41:39 matthias Exp $ -// - -require_once 'PEAR.php'; - -/** - * Provides timing and profiling information. - * - * Example 1: Automatic profiling start, stop, and output. - * - * - * setMarker('Marker 1'); - * ?> - * - * - * Example 2: Manual profiling start, stop, and output. - * - * - * start(); - * $timer->setMarker('Marker 1'); - * $timer->stop(); - * - * $timer->display(); // to output html formated - * // AND/OR : - * $profiling = $timer->getProfiling(); // get the profiler info as an associative array - * ?> - * - * - * @author Sebastian Bergmann - * @author Ludovico Magnocavallo - * @copyright Copyright © 2002-2005 Sebastian Bergmann - * @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0 - * @category Benchmarking - * @package Benchmark - */ -class Benchmark_Timer extends PEAR { - /** - * Contains the markers. - * - * @var array - * @access private - */ - var $markers = array(); - - /** - * Auto-start and stop timer. - * - * @var boolean - * @access private - */ - var $auto = FALSE; - - /** - * Max marker name length for non-html output. - * - * @var integer - * @access private - */ - var $maxStringLength = 0; - - /** - * Constructor. - * - * @param boolean $auto - * @access public - */ - function Benchmark_Timer($auto = FALSE) { - $this->auto = $auto; - - if ($this->auto) { - $this->start(); - } - - $this->PEAR(); - } - - /** - * Destructor. - * - * @access private - */ - function _Benchmark_Timer() { - if ($this->auto) { - $this->stop(); - $this->display(); - } - } - - /** - * Set "Start" marker. - * - * @see setMarker(), stop() - * @access public - */ - function start() { - $this->setMarker('Start'); - } - - /** - * Set "Stop" marker. - * - * @see setMarker(), start() - * @access public - */ - function stop() { - $this->setMarker('Stop'); - } - - /** - * Set marker. - * - * @param string $name Name of the marker to be set. - * @see start(), stop() - * @access public - */ - function setMarker($name) { - $this->markers[$name] = $this->_getMicrotime(); - } - - /** - * Returns the time elapsed betweens two markers. - * - * @param string $start start marker, defaults to "Start" - * @param string $end end marker, defaults to "Stop" - * @return double $time_elapsed time elapsed between $start and $end - * @access public - */ - function timeElapsed($start = 'Start', $end = 'Stop') { - if ($end == 'Stop' && !isset($this->markers['Stop'])) { - $this->markers['Stop'] = $this->_getMicrotime(); - } - - if (extension_loaded('bcmath')) { - return bcsub($this->markers[$end], $this->markers[$start], 6); - } else { - return $this->markers[$end] - $this->markers[$start]; - } - } - - /** - * Returns profiling information. - * - * $profiling[x]['name'] = name of marker x - * $profiling[x]['time'] = time index of marker x - * $profiling[x]['diff'] = execution time from marker x-1 to this marker x - * $profiling[x]['total'] = total execution time up to marker x - * - * @return array - * @access public - */ - function getProfiling() { - $i = $total = 0; - $result = array(); - $temp = reset($this->markers); - $this->maxStringLength = 0; - - foreach ($this->markers as $marker => $time) { - if (extension_loaded('bcmath')) { - $diff = bcsub($time, $temp, 6); - $total = bcadd($total, $diff, 6); - } else { - $diff = $time - $temp; - $total = $total + $diff; - } - - $result[$i]['name'] = $marker; - $result[$i]['time'] = $time; - $result[$i]['diff'] = $diff; - $result[$i]['total'] = $total; - - $this->maxStringLength = (strlen($marker) > $this->maxStringLength ? strlen($marker) + 1 : $this->maxStringLength); - - $temp = $time; - $i++; - } - - $result[0]['diff'] = '-'; - $result[0]['total'] = '-'; - $this->maxStringLength = (strlen('total') > $this->maxStringLength ? strlen('total') : $this->maxStringLength); - $this->maxStringLength += 2; - - return $result; - } - - /** - * Return formatted profiling information. - * - * @param boolean $showTotal Optionnaly includes total in output, default no - * @param string $format output format (auto, plain or html), default auto - * @return string - * @see getProfiling() - * @access public - */ - function getOutput($showTotal = FALSE, $format = 'auto') { - if ($format == 'auto') { - if (function_exists('version_compare') && - version_compare(phpversion(), '4.1', 'ge')) - { - $format = isset($_SERVER['SERVER_PROTOCOL']) ? 'html' : 'plain'; - } else { - global $HTTP_SERVER_VARS; - $format = isset($HTTP_SERVER_VARS['SERVER_PROTOCOL']) ? 'html' : 'plain'; - } - } - - $total = $this->TimeElapsed(); - $result = $this->getProfiling(); - $dashes = ''; - - if ($format == 'html') { - $out = ''."\n"; - $out .= ''. - ($showTotal ? - '' - : '')."\n"; - } else { - $dashes = $out = str_pad("\n", - $this->maxStringLength + ($showTotal ? 70 : 45), '-', STR_PAD_LEFT); - $out .= str_pad('marker', $this->maxStringLength) . - str_pad("time index", 22) . - str_pad("ex time", 16) . - str_pad("perct ", 8) . - ($showTotal ? ' '.str_pad("elapsed", 16)."perct" : '')."\n" . - $dashes; - } - - foreach ($result as $k => $v) { - $perc = (($v['diff'] * 100) / $total); - $tperc = (($v['total'] * 100) / $total); - - if ($format == 'html') { - $out .= "". - ($showTotal ? - "" : ''). - "\n"; - } else { - $out .= str_pad($v['name'], $this->maxStringLength, ' ') . - str_pad($v['time'], 22) . - str_pad($v['diff'], 14) . - str_pad(number_format($perc, 2, '.', '')."%",8, ' ', STR_PAD_LEFT) . - ($showTotal ? ' '. - str_pad($v['total'], 14) . - str_pad(number_format($tperc, 2, '.', '')."%", - 8, ' ', STR_PAD_LEFT) : ''). - "\n"; - } - - $out .= $dashes; - } - - if ($format == 'html') { - $out .= "".($showTotal ? "" : "")."\n"; - $out .= "
 time indexex time%elapsed%
" . $v['name'] . - "" . $v['time'] . - "" . $v['diff'] . - "" . number_format($perc, 2, '.', '') . - "%" . $v['total'] . - "" . - number_format($tperc, 2, '.', '') . - "%
total-${total}100.00%--
\n"; - } else { - $out .= str_pad('total', $this->maxStringLength); - $out .= str_pad('-', 22); - $out .= str_pad($total, 15); - $out .= "100.00%\n"; - $out .= $dashes; - } - - return $out; - } - - /** - * Prints the information returned by getOutput(). - * - * @param boolean $showTotal Optionnaly includes total in output, default no - * @param string $format output format (auto, plain or html), default auto - * @see getOutput() - * @access public - */ - function display($showTotal = FALSE, $format = 'auto') { - print $this->getOutput($showTotal, $format); - } - - /** - * Wrapper for microtime(). - * - * @return float - * @access private - * @since 1.3.0 - */ - function _getMicrotime() { - $microtime = explode(' ', microtime()); - return $microtime[1] . substr($microtime[0], 1); - } -} +. | +// +------------------------------------------------------------------------+ +// | This source file is subject to the New BSD license, That is bundled | +// | with this package in the file LICENSE, and is available through | +// | the world-wide-web at | +// | http://www.opensource.org/licenses/bsd-license.php | +// | If you did not receive a copy of the new BSDlicense and are unable | +// | to obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +------------------------------------------------------------------------+ +// +// $Id: Timer.php,v 1.16 2006/03/01 13:41:39 matthias Exp $ +// + +require_once 'PEAR.php'; + +/** + * Provides timing and profiling information. + * + * Example 1: Automatic profiling start, stop, and output. + * + * + * setMarker('Marker 1'); + * ?> + * + * + * Example 2: Manual profiling start, stop, and output. + * + * + * start(); + * $timer->setMarker('Marker 1'); + * $timer->stop(); + * + * $timer->display(); // to output html formated + * // AND/OR : + * $profiling = $timer->getProfiling(); // get the profiler info as an associative array + * ?> + * + * + * @author Sebastian Bergmann + * @author Ludovico Magnocavallo + * @copyright Copyright © 2002-2005 Sebastian Bergmann + * @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0 + * @category Benchmarking + * @package Benchmark + */ +class Benchmark_Timer extends PEAR { + /** + * Contains the markers. + * + * @var array + * @access private + */ + var $markers = array(); + + /** + * Auto-start and stop timer. + * + * @var boolean + * @access private + */ + var $auto = FALSE; + + /** + * Max marker name length for non-html output. + * + * @var integer + * @access private + */ + var $maxStringLength = 0; + + /** + * Constructor. + * + * @param boolean $auto + * @access public + */ + function Benchmark_Timer($auto = FALSE) { + $this->auto = $auto; + + if ($this->auto) { + $this->start(); + } + + $this->PEAR(); + } + + /** + * Destructor. + * + * @access private + */ + function _Benchmark_Timer() { + if ($this->auto) { + $this->stop(); + $this->display(); + } + } + + /** + * Set "Start" marker. + * + * @see setMarker(), stop() + * @access public + */ + function start() { + $this->setMarker('Start'); + } + + /** + * Set "Stop" marker. + * + * @see setMarker(), start() + * @access public + */ + function stop() { + $this->setMarker('Stop'); + } + + /** + * Set marker. + * + * @param string $name Name of the marker to be set. + * @see start(), stop() + * @access public + */ + function setMarker($name) { + $this->markers[$name] = $this->_getMicrotime(); + } + + /** + * Returns the time elapsed betweens two markers. + * + * @param string $start start marker, defaults to "Start" + * @param string $end end marker, defaults to "Stop" + * @return double $time_elapsed time elapsed between $start and $end + * @access public + */ + function timeElapsed($start = 'Start', $end = 'Stop') { + if ($end == 'Stop' && !isset($this->markers['Stop'])) { + $this->markers['Stop'] = $this->_getMicrotime(); + } + + if (extension_loaded('bcmath')) { + return bcsub($this->markers[$end], $this->markers[$start], 6); + } else { + return $this->markers[$end] - $this->markers[$start]; + } + } + + /** + * Returns profiling information. + * + * $profiling[x]['name'] = name of marker x + * $profiling[x]['time'] = time index of marker x + * $profiling[x]['diff'] = execution time from marker x-1 to this marker x + * $profiling[x]['total'] = total execution time up to marker x + * + * @return array + * @access public + */ + function getProfiling() { + $i = $total = 0; + $result = array(); + $temp = reset($this->markers); + $this->maxStringLength = 0; + + foreach ($this->markers as $marker => $time) { + if (extension_loaded('bcmath')) { + $diff = bcsub($time, $temp, 6); + $total = bcadd($total, $diff, 6); + } else { + $diff = $time - $temp; + $total = $total + $diff; + } + + $result[$i]['name'] = $marker; + $result[$i]['time'] = $time; + $result[$i]['diff'] = $diff; + $result[$i]['total'] = $total; + + $this->maxStringLength = (strlen($marker) > $this->maxStringLength ? strlen($marker) + 1 : $this->maxStringLength); + + $temp = $time; + $i++; + } + + $result[0]['diff'] = '-'; + $result[0]['total'] = '-'; + $this->maxStringLength = (strlen('total') > $this->maxStringLength ? strlen('total') : $this->maxStringLength); + $this->maxStringLength += 2; + + return $result; + } + + /** + * Return formatted profiling information. + * + * @param boolean $showTotal Optionnaly includes total in output, default no + * @param string $format output format (auto, plain or html), default auto + * @return string + * @see getProfiling() + * @access public + */ + function getOutput($showTotal = FALSE, $format = 'auto') { + if ($format == 'auto') { + if (function_exists('version_compare') && + version_compare(phpversion(), '4.1', 'ge')) + { + $format = isset($_SERVER['SERVER_PROTOCOL']) ? 'html' : 'plain'; + } else { + global $HTTP_SERVER_VARS; + $format = isset($HTTP_SERVER_VARS['SERVER_PROTOCOL']) ? 'html' : 'plain'; + } + } + + $total = $this->TimeElapsed(); + $result = $this->getProfiling(); + $dashes = ''; + + if ($format == 'html') { + $out = ''."\n"; + $out .= ''. + ($showTotal ? + '' + : '')."\n"; + } else { + $dashes = $out = str_pad("\n", + $this->maxStringLength + ($showTotal ? 70 : 45), '-', STR_PAD_LEFT); + $out .= str_pad('marker', $this->maxStringLength) . + str_pad("time index", 22) . + str_pad("ex time", 16) . + str_pad("perct ", 8) . + ($showTotal ? ' '.str_pad("elapsed", 16)."perct" : '')."\n" . + $dashes; + } + + foreach ($result as $k => $v) { + $perc = (($v['diff'] * 100) / $total); + $tperc = (($v['total'] * 100) / $total); + + if ($format == 'html') { + $out .= "". + ($showTotal ? + "" : ''). + "\n"; + } else { + $out .= str_pad($v['name'], $this->maxStringLength, ' ') . + str_pad($v['time'], 22) . + str_pad($v['diff'], 14) . + str_pad(number_format($perc, 2, '.', '')."%",8, ' ', STR_PAD_LEFT) . + ($showTotal ? ' '. + str_pad($v['total'], 14) . + str_pad(number_format($tperc, 2, '.', '')."%", + 8, ' ', STR_PAD_LEFT) : ''). + "\n"; + } + + $out .= $dashes; + } + + if ($format == 'html') { + $out .= "".($showTotal ? "" : "")."\n"; + $out .= "
 time indexex time%elapsed%
" . $v['name'] . + "" . $v['time'] . + "" . $v['diff'] . + "" . number_format($perc, 2, '.', '') . + "%" . $v['total'] . + "" . + number_format($tperc, 2, '.', '') . + "%
total-${total}100.00%--
\n"; + } else { + $out .= str_pad('total', $this->maxStringLength); + $out .= str_pad('-', 22); + $out .= str_pad($total, 15); + $out .= "100.00%\n"; + $out .= $dashes; + } + + return $out; + } + + /** + * Prints the information returned by getOutput(). + * + * @param boolean $showTotal Optionnaly includes total in output, default no + * @param string $format output format (auto, plain or html), default auto + * @see getOutput() + * @access public + */ + function display($showTotal = FALSE, $format = 'auto') { + print $this->getOutput($showTotal, $format); + } + + /** + * Wrapper for microtime(). + * + * @return float + * @access private + * @since 1.3.0 + */ + function _getMicrotime() { + $microtime = explode(' ', microtime()); + return $microtime[1] . substr($microtime[0], 1); + } +} diff --git a/buildscripts/Benchmark/doc/timer_example.php b/buildscripts/Benchmark/doc/timer_example.php index 93dd05c6..ff9de936 100644 --- a/buildscripts/Benchmark/doc/timer_example.php +++ b/buildscripts/Benchmark/doc/timer_example.php @@ -1,18 +1,18 @@ -start(); -wait(10); -$timer->setMarker('Mark1'); -echo "Elapsed time between Start and Mark1: " . - $timer->timeElapsed('Start', 'Mark1') . "\n"; -wait(50); -$timer->stop(); -$timer->display(); +start(); +wait(10); +$timer->setMarker('Mark1'); +echo "Elapsed time between Start and Mark1: " . + $timer->timeElapsed('Start', 'Mark1') . "\n"; +wait(50); +$timer->stop(); +$timer->display(); diff --git a/buildscripts/PHPUnit2/Extensions/ExceptionTestCase.php b/buildscripts/PHPUnit2/Extensions/ExceptionTestCase.php index 80afd1b5..ababf9c5 100644 --- a/buildscripts/PHPUnit2/Extensions/ExceptionTestCase.php +++ b/buildscripts/PHPUnit2/Extensions/ExceptionTestCase.php @@ -1,122 +1,122 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: ExceptionTestCase.php,v 1.15.2.6 2006/02/20 07:42:59 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/TestCase.php'; - -/** - * A TestCase that expects a specified Exception to be thrown. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Extensions_ExceptionTestCase extends PHPUnit2_Framework_TestCase { - /** - * The name of the expected Exception. - * - * @var mixed - * @access private - */ - private $expectedException = NULL; - - /** - * @return string - * @access public - * @since Method available since Release 2.2.0 - */ - public function getExpectedException() { - return $this->expectedException; - } - - /** - * @param mixed $exceptionName - * @access public - * @since Method available since Release 2.2.0 - */ - public function setExpectedException($exceptionName) { - if ((is_string($exceptionName) && class_exists($exceptionName)) || $exceptionName === NULL) { - $this->expectedException = $exceptionName; - } - } - - /** - * @access protected - */ - protected function runTest() { - try { - parent::runTest(); - } - - catch (Exception $e) { - if ($this->expectedException !== NULL && - $e instanceof $this->expectedException) { - return; - } else { - throw $e; - } - } - - if ($this->expectedException !== NULL) { - $this->fail('Expected exception ' . $this->expectedException); - } - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: ExceptionTestCase.php,v 1.15.2.6 2006/02/20 07:42:59 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/TestCase.php'; + +/** + * A TestCase that expects a specified Exception to be thrown. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Extensions_ExceptionTestCase extends PHPUnit2_Framework_TestCase { + /** + * The name of the expected Exception. + * + * @var mixed + * @access private + */ + private $expectedException = NULL; + + /** + * @return string + * @access public + * @since Method available since Release 2.2.0 + */ + public function getExpectedException() { + return $this->expectedException; + } + + /** + * @param mixed $exceptionName + * @access public + * @since Method available since Release 2.2.0 + */ + public function setExpectedException($exceptionName) { + if ((is_string($exceptionName) && class_exists($exceptionName)) || $exceptionName === NULL) { + $this->expectedException = $exceptionName; + } + } + + /** + * @access protected + */ + protected function runTest() { + try { + parent::runTest(); + } + + catch (Exception $e) { + if ($this->expectedException !== NULL && + $e instanceof $this->expectedException) { + return; + } else { + throw $e; + } + } + + if ($this->expectedException !== NULL) { + $this->fail('Expected exception ' . $this->expectedException); + } + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Extensions/PerformanceTestCase.php b/buildscripts/PHPUnit2/Extensions/PerformanceTestCase.php index 38b249a6..4d10f062 100644 --- a/buildscripts/PHPUnit2/Extensions/PerformanceTestCase.php +++ b/buildscripts/PHPUnit2/Extensions/PerformanceTestCase.php @@ -1,128 +1,128 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: PerformanceTestCase.php,v 1.15.2.5 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.1.0 - */ - -require_once 'PHPUnit2/Framework/TestCase.php'; - -require_once 'Benchmark/Timer.php'; - -/** - * A TestCase that expects a TestCase to be executed - * meeting a given time limit. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ -class PHPUnit2_Extensions_PerformanceTestCase extends PHPUnit2_Framework_TestCase { - /** - * @var integer - * @access private - */ - private $maxRunningTime = 0; - - /** - * @access protected - */ - protected function runTest() { - $timer = new Benchmark_Timer; - - $timer->start(); - parent::runTest(); - $timer->stop(); - - if ($this->maxRunningTime != 0 && - $timer->timeElapsed() > $this->maxRunningTime) { - $this->fail( - sprintf( - 'expected running time: <= %s but was: %s', - - $this->maxRunningTime, - $timer->timeElapsed() - ) - ); - } - } - - /** - * @param integer $maxRunningTime - * @throws Exception - * @access public - * @since Method available since Release 2.3.0 - */ - public function setMaxRunningTime($maxRunningTime) { - if (is_integer($maxRunningTime) && - $maxRunningTime >= 0) { - $this->maxRunningTime = $maxRunningTime; - } else { - throw new Exception; - } - } - - /** - * @return integer - * @access public - * @since Method available since Release 2.3.0 - */ - public function getMaxRunningTime() { - return $this->maxRunningTime; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: PerformanceTestCase.php,v 1.15.2.5 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.1.0 + */ + +require_once 'PHPUnit2/Framework/TestCase.php'; + +require_once 'Benchmark/Timer.php'; + +/** + * A TestCase that expects a TestCase to be executed + * meeting a given time limit. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ +class PHPUnit2_Extensions_PerformanceTestCase extends PHPUnit2_Framework_TestCase { + /** + * @var integer + * @access private + */ + private $maxRunningTime = 0; + + /** + * @access protected + */ + protected function runTest() { + $timer = new Benchmark_Timer; + + $timer->start(); + parent::runTest(); + $timer->stop(); + + if ($this->maxRunningTime != 0 && + $timer->timeElapsed() > $this->maxRunningTime) { + $this->fail( + sprintf( + 'expected running time: <= %s but was: %s', + + $this->maxRunningTime, + $timer->timeElapsed() + ) + ); + } + } + + /** + * @param integer $maxRunningTime + * @throws Exception + * @access public + * @since Method available since Release 2.3.0 + */ + public function setMaxRunningTime($maxRunningTime) { + if (is_integer($maxRunningTime) && + $maxRunningTime >= 0) { + $this->maxRunningTime = $maxRunningTime; + } else { + throw new Exception; + } + } + + /** + * @return integer + * @access public + * @since Method available since Release 2.3.0 + */ + public function getMaxRunningTime() { + return $this->maxRunningTime; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Extensions/RepeatedTest.php b/buildscripts/PHPUnit2/Extensions/RepeatedTest.php index c23b0915..b842aa1b 100644 --- a/buildscripts/PHPUnit2/Extensions/RepeatedTest.php +++ b/buildscripts/PHPUnit2/Extensions/RepeatedTest.php @@ -1,138 +1,138 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: RepeatedTest.php,v 1.15.2.4 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Extensions/TestDecorator.php'; - -/** - * A Decorator that runs a test repeatedly. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Extensions_RepeatedTest extends PHPUnit2_Extensions_TestDecorator { - /** - * @var integer - * @access private - */ - private $timesRepeat = 1; - - /** - * Constructor. - * - * @param PHPUnit2_Framework_Test $test - * @param integer $timesRepeat - * @throws Exception - * @access public - */ - public function __construct(PHPUnit2_Framework_Test $test, $timesRepeat = 1) { - parent::__construct($test); - - if (is_integer($timesRepeat) && - $timesRepeat >= 0) { - $this->timesRepeat = $timesRepeat; - } else { - throw new Exception( - 'Argument 2 must be a positive integer.' - ); - } - } - - /** - * Counts the number of test cases that - * will be run by this test. - * - * @return integer - * @access public - */ - public function countTestCases() { - return $this->timesRepeat * $this->test->countTestCases(); - } - - /** - * Runs the decorated test and collects the - * result in a TestResult. - * - * @param PHPUnit2_Framework_TestResult $result - * @return PHPUnit2_Framework_TestResult - * @throws Exception - * @access public - */ - public function run($result = NULL) { - if ($result === NULL) { - $result = $this->createResult(); - } - - // XXX: Workaround for missing ability to declare type-hinted parameters as optional. - else if (!($result instanceof PHPUnit2_Framework_TestResult)) { - throw new Exception( - 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' - ); - } - - for ($i = 0; $i < $this->timesRepeat && !$result->shouldStop(); $i++) { - $this->test->run($result); - } - - return $result; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: RepeatedTest.php,v 1.15.2.4 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Extensions/TestDecorator.php'; + +/** + * A Decorator that runs a test repeatedly. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Extensions_RepeatedTest extends PHPUnit2_Extensions_TestDecorator { + /** + * @var integer + * @access private + */ + private $timesRepeat = 1; + + /** + * Constructor. + * + * @param PHPUnit2_Framework_Test $test + * @param integer $timesRepeat + * @throws Exception + * @access public + */ + public function __construct(PHPUnit2_Framework_Test $test, $timesRepeat = 1) { + parent::__construct($test); + + if (is_integer($timesRepeat) && + $timesRepeat >= 0) { + $this->timesRepeat = $timesRepeat; + } else { + throw new Exception( + 'Argument 2 must be a positive integer.' + ); + } + } + + /** + * Counts the number of test cases that + * will be run by this test. + * + * @return integer + * @access public + */ + public function countTestCases() { + return $this->timesRepeat * $this->test->countTestCases(); + } + + /** + * Runs the decorated test and collects the + * result in a TestResult. + * + * @param PHPUnit2_Framework_TestResult $result + * @return PHPUnit2_Framework_TestResult + * @throws Exception + * @access public + */ + public function run($result = NULL) { + if ($result === NULL) { + $result = $this->createResult(); + } + + // XXX: Workaround for missing ability to declare type-hinted parameters as optional. + else if (!($result instanceof PHPUnit2_Framework_TestResult)) { + throw new Exception( + 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' + ); + } + + for ($i = 0; $i < $this->timesRepeat && !$result->shouldStop(); $i++) { + $this->test->run($result); + } + + return $result; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Extensions/TestDecorator.php b/buildscripts/PHPUnit2/Extensions/TestDecorator.php index 3557eeca..ebca6e1f 100644 --- a/buildscripts/PHPUnit2/Extensions/TestDecorator.php +++ b/buildscripts/PHPUnit2/Extensions/TestDecorator.php @@ -1,174 +1,174 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestDecorator.php,v 1.14.2.4 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/Assert.php'; -require_once 'PHPUnit2/Framework/Test.php'; -require_once 'PHPUnit2/Framework/TestResult.php'; - -/** - * A Decorator for Tests. - * - * Use TestDecorator as the base class for defining new - * test decorators. Test decorator subclasses can be introduced - * to add behaviour before or after a test is run. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Extensions_TestDecorator extends PHPUnit2_Framework_Assert implements PHPUnit2_Framework_Test { - /** - * The Test to be decorated. - * - * @var object - * @access protected - */ - protected $test = NULL; - - /** - * Constructor. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function __construct(PHPUnit2_Framework_Test $test) { - $this->test = $test; - } - - /** - * Returns a string representation of the test. - * - * @return string - * @access public - */ - public function toString() { - return $this->test->toString(); - } - - /** - * Runs the test and collects the - * result in a TestResult. - * - * @param PHPUnit2_Framework_TestResult $result - * @access public - */ - public function basicRun(PHPUnit2_Framework_TestResult $result) { - $this->test->run($result); - } - - /** - * Counts the number of test cases that - * will be run by this test. - * - * @return integer - * @access public - */ - public function countTestCases() { - return $this->test->countTestCases(); - } - - /** - * Creates a default TestResult object. - * - * @return PHPUnit2_Framework_TestResult - * @access protected - */ - protected function createResult() { - return new PHPUnit2_Framework_TestResult; - } - - /** - * Returns the test to be run. - * - * @return PHPUnit2_Framework_Test - * @access public - */ - public function getTest() { - return $this->test; - } - - /** - * Runs the decorated test and collects the - * result in a TestResult. - * - * @param PHPUnit2_Framework_TestResult $result - * @return PHPUnit2_Framework_TestResult - * @throws Exception - * @access public - */ - public function run($result = NULL) { - if ($result === NULL) { - $result = $this->createResult(); - } - - // XXX: Workaround for missing ability to declare type-hinted parameters as optional. - else if (!($result instanceof PHPUnit2_Framework_TestResult)) { - throw new Exception( - 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' - ); - } - - $this->basicRun($result); - - return $result; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestDecorator.php,v 1.14.2.4 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/Assert.php'; +require_once 'PHPUnit2/Framework/Test.php'; +require_once 'PHPUnit2/Framework/TestResult.php'; + +/** + * A Decorator for Tests. + * + * Use TestDecorator as the base class for defining new + * test decorators. Test decorator subclasses can be introduced + * to add behaviour before or after a test is run. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Extensions_TestDecorator extends PHPUnit2_Framework_Assert implements PHPUnit2_Framework_Test { + /** + * The Test to be decorated. + * + * @var object + * @access protected + */ + protected $test = NULL; + + /** + * Constructor. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function __construct(PHPUnit2_Framework_Test $test) { + $this->test = $test; + } + + /** + * Returns a string representation of the test. + * + * @return string + * @access public + */ + public function toString() { + return $this->test->toString(); + } + + /** + * Runs the test and collects the + * result in a TestResult. + * + * @param PHPUnit2_Framework_TestResult $result + * @access public + */ + public function basicRun(PHPUnit2_Framework_TestResult $result) { + $this->test->run($result); + } + + /** + * Counts the number of test cases that + * will be run by this test. + * + * @return integer + * @access public + */ + public function countTestCases() { + return $this->test->countTestCases(); + } + + /** + * Creates a default TestResult object. + * + * @return PHPUnit2_Framework_TestResult + * @access protected + */ + protected function createResult() { + return new PHPUnit2_Framework_TestResult; + } + + /** + * Returns the test to be run. + * + * @return PHPUnit2_Framework_Test + * @access public + */ + public function getTest() { + return $this->test; + } + + /** + * Runs the decorated test and collects the + * result in a TestResult. + * + * @param PHPUnit2_Framework_TestResult $result + * @return PHPUnit2_Framework_TestResult + * @throws Exception + * @access public + */ + public function run($result = NULL) { + if ($result === NULL) { + $result = $this->createResult(); + } + + // XXX: Workaround for missing ability to declare type-hinted parameters as optional. + else if (!($result instanceof PHPUnit2_Framework_TestResult)) { + throw new Exception( + 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' + ); + } + + $this->basicRun($result); + + return $result; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Extensions/TestSetup.php b/buildscripts/PHPUnit2/Extensions/TestSetup.php index 4d28f931..153cfcf1 100644 --- a/buildscripts/PHPUnit2/Extensions/TestSetup.php +++ b/buildscripts/PHPUnit2/Extensions/TestSetup.php @@ -1,154 +1,154 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestSetup.php,v 1.13.2.6 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/TestSuite.php'; -require_once 'PHPUnit2/Extensions/TestDecorator.php'; - -/** - * A Decorator to set up and tear down additional fixture state. - * Subclass TestSetup and insert it into your tests when you want - * to set up additional state once before the tests are run. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Extensions_TestSetup extends PHPUnit2_Extensions_TestDecorator { - /** - * Runs the decorated test and collects the - * result in a TestResult. - * - * @param PHPUnit2_Framework_TestResult $result - * @return PHPUnit2_Framework_TestResult - * @throws Exception - * @access public - */ - public function run($result = NULL) { - if ($result === NULL) { - $result = $this->createResult(); - } - - // XXX: Workaround for missing ability to declare type-hinted parameters as optional. - else if (!($result instanceof PHPUnit2_Framework_TestResult)) { - throw new Exception( - 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' - ); - } - - $this->setUp(); - $this->copyFixtureToTest(); - $this->basicRun($result); - $this->tearDown(); - - return $result; - } - - /** - * Copies the fixture set up by setUp() to the test. - * - * @access private - * @since Method available since Release 2.3.0 - */ - private function copyFixtureToTest() { - $object = new ReflectionClass($this); - - foreach ($object->getProperties() as $property) { - $name = $property->getName(); - - if ($name != 'test') { - $this->doCopyFixtureToTest($this->test, $name, $this->$name); - } - } - } - - /** - * @access private - * @since Method available since Release 2.3.0 - */ - private function doCopyFixtureToTest($object, $name, &$value) { - if ($object instanceof PHPUnit2_Framework_TestSuite) { - foreach ($object->tests() as $test) { - $this->doCopyFixtureToTest($test, $name, $value); - } - } else { - $object->$name =& $value; - } - } - - /** - * Sets up the fixture. Override to set up additional fixture - * state. - * - * @access protected - */ - protected function setUp() { - } - - /** - * Tears down the fixture. Override to tear down the additional - * fixture state. - * - * @access protected - */ - protected function tearDown() { - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestSetup.php,v 1.13.2.6 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/TestSuite.php'; +require_once 'PHPUnit2/Extensions/TestDecorator.php'; + +/** + * A Decorator to set up and tear down additional fixture state. + * Subclass TestSetup and insert it into your tests when you want + * to set up additional state once before the tests are run. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Extensions_TestSetup extends PHPUnit2_Extensions_TestDecorator { + /** + * Runs the decorated test and collects the + * result in a TestResult. + * + * @param PHPUnit2_Framework_TestResult $result + * @return PHPUnit2_Framework_TestResult + * @throws Exception + * @access public + */ + public function run($result = NULL) { + if ($result === NULL) { + $result = $this->createResult(); + } + + // XXX: Workaround for missing ability to declare type-hinted parameters as optional. + else if (!($result instanceof PHPUnit2_Framework_TestResult)) { + throw new Exception( + 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' + ); + } + + $this->setUp(); + $this->copyFixtureToTest(); + $this->basicRun($result); + $this->tearDown(); + + return $result; + } + + /** + * Copies the fixture set up by setUp() to the test. + * + * @access private + * @since Method available since Release 2.3.0 + */ + private function copyFixtureToTest() { + $object = new ReflectionClass($this); + + foreach ($object->getProperties() as $property) { + $name = $property->getName(); + + if ($name != 'test') { + $this->doCopyFixtureToTest($this->test, $name, $this->$name); + } + } + } + + /** + * @access private + * @since Method available since Release 2.3.0 + */ + private function doCopyFixtureToTest($object, $name, &$value) { + if ($object instanceof PHPUnit2_Framework_TestSuite) { + foreach ($object->tests() as $test) { + $this->doCopyFixtureToTest($test, $name, $value); + } + } else { + $object->$name =& $value; + } + } + + /** + * Sets up the fixture. Override to set up additional fixture + * state. + * + * @access protected + */ + protected function setUp() { + } + + /** + * Tears down the fixture. Override to tear down the additional + * fixture state. + * + * @access protected + */ + protected function tearDown() { + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/Assert.php b/buildscripts/PHPUnit2/Framework/Assert.php index 3465afea..ef79e883 100644 --- a/buildscripts/PHPUnit2/Framework/Assert.php +++ b/buildscripts/PHPUnit2/Framework/Assert.php @@ -1,626 +1,626 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Assert.php,v 1.45.2.4 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/AssertionFailedError.php'; -require_once 'PHPUnit2/Framework/ComparisonFailure.php'; - -/** - * A set of assert methods. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - * @static - */ -class PHPUnit2_Framework_Assert { - /** - * @var boolean - * @access private - * @static - */ - private static $looselyTyped = FALSE; - - /** - * Protect constructor since it is a static only class. - * - * @access protected - */ - protected function __construct() { - } - - /** - * Asserts that a haystack contains a needle. - * - * @param mixed $needle - * @param mixed $haystack - * @param string $message - * @access public - * @static - * @since Method available since Release 2.1.0 - */ - public static function assertContains($needle, $haystack, $message = '') { - self::doAssertContains($needle, $haystack, TRUE, $message); - } - - /** - * Asserts that a haystack does not contain a needle. - * - * @param mixed $needle - * @param mixed $haystack - * @param string $message - * @access public - * @static - * @since Method available since Release 2.1.0 - */ - public static function assertNotContains($needle, $haystack, $message = '') { - self::doAssertContains($needle, $haystack, FALSE, $message); - } - - /** - * @param mixed $needle - * @param mixed $haystack - * @param boolean $condition - * @param string $message - * @throws Exception - * @access private - * @static - * @since Method available since Release 2.2.0 - */ - private static function doAssertContains($needle, $haystack, $condition, $message) { - $found = FALSE; - - if (is_array($haystack) || - (is_object($haystack) && $haystack instanceof Iterator)) { - foreach ($haystack as $straw) { - if ($straw === $needle) { - $found = TRUE; - break; - } - } - } - - else if (is_string($needle) && is_string($haystack)) { - if (strpos($haystack, $needle) !== FALSE) { - $found = TRUE; - } - } - - else { - throw new Exception; - } - - if ($condition && !$found) { - self::fail( - sprintf( - '%s%s"%s" does not contain "%s"', - - $message, - ($message != '') ? ' ' : '', - self::objectToString($haystack), - self::objectToString($needle) - ) - ); - } - - else if (!$condition && $found) { - self::fail( - sprintf( - '%s%s"%s" contains "%s"', - - $message, - ($message != '') ? ' ' : '', - self::objectToString($haystack), - self::objectToString($needle) - ) - ); - } - } - - /** - * Asserts that two variables are equal. - * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @param mixed $delta - * @access public - * @static - */ - public static function assertEquals($expected, $actual, $message = '', $delta = 0) { - self::doAssertEquals($expected, $actual, $delta, TRUE, $message); - } - - /** - * Asserts that two variables are not equal. - * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @param mixed $delta - * @access public - * @static - * @since Method available since Release 2.3.0 - */ - public static function assertNotEquals($expected, $actual, $message = '', $delta = 0) { - self::doAssertEquals($expected, $actual, $delta, FALSE, $message); - } - - /** - * @param mixed $expected - * @param mixed $actual - * @param mixed $delta - * @param boolean $condition - * @param string $message - * @access private - * @static - * @since Method available since Release 2.3.0 - */ - private static function doAssertEquals($expected, $actual, $delta, $condition, $message) { - $equal = FALSE; - - if (is_array($expected)) { - if (is_array($actual)) { - self::sortArrayRecursively($actual); - self::sortArrayRecursively($expected); - - if (self::$looselyTyped) { - $actual = self::convertToString($actual); - $expected = self::convertToString($expected); - } - - $equal = (serialize($expected) == serialize($actual)); - } - } - - else if (is_float($expected) && is_float($actual) && is_float($delta)) { - $equal = (abs($expected - $actual) <= $delta); - } - - else { - $equal = (serialize($expected) == serialize($actual)); - } - - if ($condition && !$equal) { - self::failNotSame( - $expected, - $actual, - $message - ); - } - - else if (!$condition && $equal) { - self::failSame( - $expected, - $actual, - $message - ); - } - } - - /** - * Asserts that a condition is true. - * - * @param boolean $condition - * @param string $message - * @throws Exception - * @access public - * @static - */ - public static function assertTrue($condition, $message = '') { - if (is_bool($condition)) { - if (!$condition) { - self::fail($message); - } - } else { - throw new Exception; - } - } - - /** - * Asserts that a condition is false. - * - * @param boolean $condition - * @param string $message - * @throws Exception - * @access public - * @static - */ - public static function assertFalse($condition, $message = '') { - if (is_bool($condition)) { - self::assertTrue(!$condition, $message); - } else { - throw new Exception; - } - } - - /** - * Asserts that a variable is not NULL. - * - * @param mixed $actual - * @param string $message - * @access public - * @static - */ - public static function assertNotNull($actual, $message = '') { - if (is_null($actual)) { - self::fail(self::format('NOT NULL', 'NULL', $message)); - } - } - - /** - * Asserts that a variable is NULL. - * - * @param mixed $actual - * @param string $message - * @access public - * @static - */ - public static function assertNull($actual, $message = '') { - if (!is_null($actual)) { - self::fail(self::format('NULL', 'NOT NULL', $message)); - } - } - - /** - * Asserts that two variables have the same type and value. - * Used on objects, it asserts that two variables reference - * the same object. - * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @access public - * @static - */ - public static function assertSame($expected, $actual, $message = '') { - if ($expected !== $actual) { - self::failNotSame($expected, $actual, $message); - } - } - - /** - * Asserts that two variables do not have the same type and value. - * Used on objects, it asserts that two variables do not reference - * the same object. - * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @access public - * @static - */ - public static function assertNotSame($expected, $actual, $message = '') { - if ($expected === $actual) { - self::failSame($expected, $actual, $message); - } - } - - /** - * Asserts that a variable is of a given type. - * - * @param string $expected - * @param mixed $actual - * @param string $message - * @access public - * @static - */ - public static function assertType($expected, $actual, $message = '') { - self::doAssertType($expected, $actual, TRUE, $message); - } - - /** - * Asserts that a variable is not of a given type. - * - * @param string $expected - * @param mixed $actual - * @param string $message - * @access public - * @static - * @since Method available since Release 2.2.0 - */ - public static function assertNotType($expected, $actual, $message = '') { - self::doAssertType($expected, $actual, FALSE, $message); - } - - /** - * @param string $expected - * @param mixed $actual - * @param boolean $condition - * @param string $message - * @access private - * @static - * @since Method available since Release 2.2.0 - */ - private static function doAssertType($expected, $actual, $condition, $message) { - if (!is_string($expected)) { - throw new Exception; - } - - if (is_object($actual)) { - $result = $actual instanceof $expected; - } else { - $result = (gettype($actual) == $expected); - } - - if ($condition && !$result) { - self::failNotSame( - $expected, - $actual, - $message - ); - } - - else if (!$condition && $result) { - self::failSame( - $expected, - $actual, - $message - ); - } - } - - /** - * Asserts that a string matches a given regular expression. - * - * @param string $pattern - * @param string $string - * @param string $message - * @access public - * @static - */ - public static function assertRegExp($pattern, $string, $message = '') { - self::doAssertRegExp($pattern, $string, TRUE, $message); - } - - /** - * Asserts that a string does not match a given regular expression. - * - * @param string $pattern - * @param string $string - * @param string $message - * @access public - * @static - * @since Method available since Release 2.1.0 - */ - public static function assertNotRegExp($pattern, $string, $message = '') { - self::doAssertRegExp($pattern, $string, FALSE, $message); - } - - /** - * @param mixed $pattern - * @param mixed $string - * @param boolean $condition - * @param string $message - * @access private - * @static - * @since Method available since Release 2.2.0 - */ - private static function doAssertRegExp($pattern, $string, $condition, $message) { - if (!is_string($pattern) || !is_string($string)) { - throw new Exception; - } - - $result = preg_match($pattern, $string); - - if ($condition && !$result) { - self::fail( - sprintf( - '%s%s"%s" does not match pattern "%s"', - - $message, - ($message != '') ? ' ' : '', - $string, - $pattern - ) - ); - } - - else if (!$condition && $result) { - self::fail( - sprintf( - '%s%s"%s" matches pattern "%s"', - - $message, - ($message != '') ? ' ' : '', - $string, - $pattern - ) - ); - } - } - - /** - * Fails a test with the given message. - * - * @param string $message - * @throws PHPUnit2_Framework_AssertionFailedError - * @access public - * @static - */ - public static function fail($message = '') { - throw new PHPUnit2_Framework_AssertionFailedError($message); - } - - /** - * @param string $message - * @throws PHPUnit2_Framework_AssertionFailedError - * @access private - * @static - */ - private static function failSame($message) { - self::fail( - sprintf( - '%s%sexpected not same', - - $message, - ($message != '') ? ' ' : '' - ) - ); - } - - /** - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @throws PHPUnit2_Framework_AssertionFailedError - * @access private - * @static - */ - private static function failNotSame($expected, $actual, $message) { - if (is_string($expected) && is_string($actual)) { - throw new PHPUnit2_Framework_ComparisonFailure($expected, $actual, $message); - } - - self::fail( - sprintf( - '%s%sexpected same: <%s> was not: <%s>', - - $message, - ($message != '') ? ' ' : '', - self::objectToString($expected), - self::objectToString($actual) - ) - ); - } - - /** - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @access public - * @static - */ - public static function format($expected, $actual, $message) { - return sprintf( - '%s%sexpected: <%s> but was: <%s>', - - $message, - ($message != '') ? ' ' : '', - self::objectToString($expected), - self::objectToString($actual) - ); - } - - /** - * @param boolean $looselyTyped - * @access public - * @static - */ - public static function setLooselyTyped($looselyTyped) { - if (is_bool($looselyTyped)) { - self::$looselyTyped = $looselyTyped; - } - } - - /** - * Converts a value to a string. - * - * @param mixed $value - * @access private - * @static - */ - private static function convertToString($value) { - foreach ($value as $k => $v) { - if (is_array($v)) { - $value[$k] = self::convertToString($value[$k]); - } else if (is_object($v)) { - $value[$k] = self::objectToString($value[$k]); - } else { - settype($value[$k], 'string'); - } - } - - return $value; - } - - /** - * @param mixed $object - * @return string - * @access private - * @static - */ - private static function objectToString($object) { - if (is_array($object) || is_object($object)) { - $object = serialize($object); - } - - return $object; - } - - /** - * Sorts an array recursively by its keys. - * - * @param array $array - * @access private - * @static - * @author Adam Maccabee Trachtenberg - */ - private static function sortArrayRecursively(&$array) { - ksort($array); - - foreach($array as $k => $v) { - if (is_array($v)) { - self::sortArrayRecursively($array[$k]); - } - } - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Assert.php,v 1.45.2.4 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/AssertionFailedError.php'; +require_once 'PHPUnit2/Framework/ComparisonFailure.php'; + +/** + * A set of assert methods. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + * @static + */ +class PHPUnit2_Framework_Assert { + /** + * @var boolean + * @access private + * @static + */ + private static $looselyTyped = FALSE; + + /** + * Protect constructor since it is a static only class. + * + * @access protected + */ + protected function __construct() { + } + + /** + * Asserts that a haystack contains a needle. + * + * @param mixed $needle + * @param mixed $haystack + * @param string $message + * @access public + * @static + * @since Method available since Release 2.1.0 + */ + public static function assertContains($needle, $haystack, $message = '') { + self::doAssertContains($needle, $haystack, TRUE, $message); + } + + /** + * Asserts that a haystack does not contain a needle. + * + * @param mixed $needle + * @param mixed $haystack + * @param string $message + * @access public + * @static + * @since Method available since Release 2.1.0 + */ + public static function assertNotContains($needle, $haystack, $message = '') { + self::doAssertContains($needle, $haystack, FALSE, $message); + } + + /** + * @param mixed $needle + * @param mixed $haystack + * @param boolean $condition + * @param string $message + * @throws Exception + * @access private + * @static + * @since Method available since Release 2.2.0 + */ + private static function doAssertContains($needle, $haystack, $condition, $message) { + $found = FALSE; + + if (is_array($haystack) || + (is_object($haystack) && $haystack instanceof Iterator)) { + foreach ($haystack as $straw) { + if ($straw === $needle) { + $found = TRUE; + break; + } + } + } + + else if (is_string($needle) && is_string($haystack)) { + if (strpos($haystack, $needle) !== FALSE) { + $found = TRUE; + } + } + + else { + throw new Exception; + } + + if ($condition && !$found) { + self::fail( + sprintf( + '%s%s"%s" does not contain "%s"', + + $message, + ($message != '') ? ' ' : '', + self::objectToString($haystack), + self::objectToString($needle) + ) + ); + } + + else if (!$condition && $found) { + self::fail( + sprintf( + '%s%s"%s" contains "%s"', + + $message, + ($message != '') ? ' ' : '', + self::objectToString($haystack), + self::objectToString($needle) + ) + ); + } + } + + /** + * Asserts that two variables are equal. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @param mixed $delta + * @access public + * @static + */ + public static function assertEquals($expected, $actual, $message = '', $delta = 0) { + self::doAssertEquals($expected, $actual, $delta, TRUE, $message); + } + + /** + * Asserts that two variables are not equal. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @param mixed $delta + * @access public + * @static + * @since Method available since Release 2.3.0 + */ + public static function assertNotEquals($expected, $actual, $message = '', $delta = 0) { + self::doAssertEquals($expected, $actual, $delta, FALSE, $message); + } + + /** + * @param mixed $expected + * @param mixed $actual + * @param mixed $delta + * @param boolean $condition + * @param string $message + * @access private + * @static + * @since Method available since Release 2.3.0 + */ + private static function doAssertEquals($expected, $actual, $delta, $condition, $message) { + $equal = FALSE; + + if (is_array($expected)) { + if (is_array($actual)) { + self::sortArrayRecursively($actual); + self::sortArrayRecursively($expected); + + if (self::$looselyTyped) { + $actual = self::convertToString($actual); + $expected = self::convertToString($expected); + } + + $equal = (serialize($expected) == serialize($actual)); + } + } + + else if (is_float($expected) && is_float($actual) && is_float($delta)) { + $equal = (abs($expected - $actual) <= $delta); + } + + else { + $equal = (serialize($expected) == serialize($actual)); + } + + if ($condition && !$equal) { + self::failNotSame( + $expected, + $actual, + $message + ); + } + + else if (!$condition && $equal) { + self::failSame( + $expected, + $actual, + $message + ); + } + } + + /** + * Asserts that a condition is true. + * + * @param boolean $condition + * @param string $message + * @throws Exception + * @access public + * @static + */ + public static function assertTrue($condition, $message = '') { + if (is_bool($condition)) { + if (!$condition) { + self::fail($message); + } + } else { + throw new Exception; + } + } + + /** + * Asserts that a condition is false. + * + * @param boolean $condition + * @param string $message + * @throws Exception + * @access public + * @static + */ + public static function assertFalse($condition, $message = '') { + if (is_bool($condition)) { + self::assertTrue(!$condition, $message); + } else { + throw new Exception; + } + } + + /** + * Asserts that a variable is not NULL. + * + * @param mixed $actual + * @param string $message + * @access public + * @static + */ + public static function assertNotNull($actual, $message = '') { + if (is_null($actual)) { + self::fail(self::format('NOT NULL', 'NULL', $message)); + } + } + + /** + * Asserts that a variable is NULL. + * + * @param mixed $actual + * @param string $message + * @access public + * @static + */ + public static function assertNull($actual, $message = '') { + if (!is_null($actual)) { + self::fail(self::format('NULL', 'NOT NULL', $message)); + } + } + + /** + * Asserts that two variables have the same type and value. + * Used on objects, it asserts that two variables reference + * the same object. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @access public + * @static + */ + public static function assertSame($expected, $actual, $message = '') { + if ($expected !== $actual) { + self::failNotSame($expected, $actual, $message); + } + } + + /** + * Asserts that two variables do not have the same type and value. + * Used on objects, it asserts that two variables do not reference + * the same object. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @access public + * @static + */ + public static function assertNotSame($expected, $actual, $message = '') { + if ($expected === $actual) { + self::failSame($expected, $actual, $message); + } + } + + /** + * Asserts that a variable is of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @access public + * @static + */ + public static function assertType($expected, $actual, $message = '') { + self::doAssertType($expected, $actual, TRUE, $message); + } + + /** + * Asserts that a variable is not of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @access public + * @static + * @since Method available since Release 2.2.0 + */ + public static function assertNotType($expected, $actual, $message = '') { + self::doAssertType($expected, $actual, FALSE, $message); + } + + /** + * @param string $expected + * @param mixed $actual + * @param boolean $condition + * @param string $message + * @access private + * @static + * @since Method available since Release 2.2.0 + */ + private static function doAssertType($expected, $actual, $condition, $message) { + if (!is_string($expected)) { + throw new Exception; + } + + if (is_object($actual)) { + $result = $actual instanceof $expected; + } else { + $result = (gettype($actual) == $expected); + } + + if ($condition && !$result) { + self::failNotSame( + $expected, + $actual, + $message + ); + } + + else if (!$condition && $result) { + self::failSame( + $expected, + $actual, + $message + ); + } + } + + /** + * Asserts that a string matches a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + * @access public + * @static + */ + public static function assertRegExp($pattern, $string, $message = '') { + self::doAssertRegExp($pattern, $string, TRUE, $message); + } + + /** + * Asserts that a string does not match a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + * @access public + * @static + * @since Method available since Release 2.1.0 + */ + public static function assertNotRegExp($pattern, $string, $message = '') { + self::doAssertRegExp($pattern, $string, FALSE, $message); + } + + /** + * @param mixed $pattern + * @param mixed $string + * @param boolean $condition + * @param string $message + * @access private + * @static + * @since Method available since Release 2.2.0 + */ + private static function doAssertRegExp($pattern, $string, $condition, $message) { + if (!is_string($pattern) || !is_string($string)) { + throw new Exception; + } + + $result = preg_match($pattern, $string); + + if ($condition && !$result) { + self::fail( + sprintf( + '%s%s"%s" does not match pattern "%s"', + + $message, + ($message != '') ? ' ' : '', + $string, + $pattern + ) + ); + } + + else if (!$condition && $result) { + self::fail( + sprintf( + '%s%s"%s" matches pattern "%s"', + + $message, + ($message != '') ? ' ' : '', + $string, + $pattern + ) + ); + } + } + + /** + * Fails a test with the given message. + * + * @param string $message + * @throws PHPUnit2_Framework_AssertionFailedError + * @access public + * @static + */ + public static function fail($message = '') { + throw new PHPUnit2_Framework_AssertionFailedError($message); + } + + /** + * @param string $message + * @throws PHPUnit2_Framework_AssertionFailedError + * @access private + * @static + */ + private static function failSame($message) { + self::fail( + sprintf( + '%s%sexpected not same', + + $message, + ($message != '') ? ' ' : '' + ) + ); + } + + /** + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @throws PHPUnit2_Framework_AssertionFailedError + * @access private + * @static + */ + private static function failNotSame($expected, $actual, $message) { + if (is_string($expected) && is_string($actual)) { + throw new PHPUnit2_Framework_ComparisonFailure($expected, $actual, $message); + } + + self::fail( + sprintf( + '%s%sexpected same: <%s> was not: <%s>', + + $message, + ($message != '') ? ' ' : '', + self::objectToString($expected), + self::objectToString($actual) + ) + ); + } + + /** + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @access public + * @static + */ + public static function format($expected, $actual, $message) { + return sprintf( + '%s%sexpected: <%s> but was: <%s>', + + $message, + ($message != '') ? ' ' : '', + self::objectToString($expected), + self::objectToString($actual) + ); + } + + /** + * @param boolean $looselyTyped + * @access public + * @static + */ + public static function setLooselyTyped($looselyTyped) { + if (is_bool($looselyTyped)) { + self::$looselyTyped = $looselyTyped; + } + } + + /** + * Converts a value to a string. + * + * @param mixed $value + * @access private + * @static + */ + private static function convertToString($value) { + foreach ($value as $k => $v) { + if (is_array($v)) { + $value[$k] = self::convertToString($value[$k]); + } else if (is_object($v)) { + $value[$k] = self::objectToString($value[$k]); + } else { + settype($value[$k], 'string'); + } + } + + return $value; + } + + /** + * @param mixed $object + * @return string + * @access private + * @static + */ + private static function objectToString($object) { + if (is_array($object) || is_object($object)) { + $object = serialize($object); + } + + return $object; + } + + /** + * Sorts an array recursively by its keys. + * + * @param array $array + * @access private + * @static + * @author Adam Maccabee Trachtenberg + */ + private static function sortArrayRecursively(&$array) { + ksort($array); + + foreach($array as $k => $v) { + if (is_array($v)) { + self::sortArrayRecursively($array[$k]); + } + } + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/AssertionFailedError.php b/buildscripts/PHPUnit2/Framework/AssertionFailedError.php index d3db50ed..19bb1dc0 100644 --- a/buildscripts/PHPUnit2/Framework/AssertionFailedError.php +++ b/buildscripts/PHPUnit2/Framework/AssertionFailedError.php @@ -1,80 +1,80 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: AssertionFailedError.php,v 1.9.2.2 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -/** - * Thrown when an assertion failed. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Framework_AssertionFailedError extends Exception { - /** - * Wrapper for getMessage() which is declared as final. - * - * @return string - * @access public - */ - public function toString() { - return $this->getMessage(); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: AssertionFailedError.php,v 1.9.2.2 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +/** + * Thrown when an assertion failed. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Framework_AssertionFailedError extends Exception { + /** + * Wrapper for getMessage() which is declared as final. + * + * @return string + * @access public + */ + public function toString() { + return $this->getMessage(); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/ComparisonFailure.php b/buildscripts/PHPUnit2/Framework/ComparisonFailure.php index cc8e26e6..6e6e5b3d 100644 --- a/buildscripts/PHPUnit2/Framework/ComparisonFailure.php +++ b/buildscripts/PHPUnit2/Framework/ComparisonFailure.php @@ -1,153 +1,153 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: ComparisonFailure.php,v 1.13.2.3 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/Assert.php'; -require_once 'PHPUnit2/Framework/AssertionFailedError.php'; - -/** - * Thrown when an assertion for string equality failed. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Framework_ComparisonFailure extends PHPUnit2_Framework_AssertionFailedError { - /** - * @var string - * @access private - */ - private $expected = ''; - - /** - * @var string - * @access private - */ - private $actual = ''; - - /** - * Constructs a comparison failure. - * - * @param string $expected - * @param string $actual - * @param string $message - * @access public - */ - public function __construct($expected, $actual, $message = '') { - parent::__construct($message); - - $this->expected = ($expected === NULL) ? 'NULL' : $expected; - $this->actual = ($actual === NULL) ? 'NULL' : $actual; - } - - /** - * Returns "..." in place of common prefix and "..." in - * place of common suffix between expected and actual. - * - * @return string - * @access public - */ - public function toString() { - $end = min(strlen($this->expected), strlen($this->actual)); - $i = 0; - $j = strlen($this->expected) - 1; - $k = strlen($this->actual) - 1; - - for (; $i < $end; $i++) { - if ($this->expected[$i] != $this->actual[$i]) { - break; - } - } - - for (; $k >= $i && $j >= $i; $k--,$j--) { - if ($this->expected[$j] != $this->actual[$k]) { - break; - } - } - - if ($j < $i && $k < $i) { - $expected = $this->expected; - $actual = $this->actual; - } else { - $expected = substr($this->expected, $i, ($j + 1 - $i)); - $actual = substr($this->actual, $i, ($k + 1 - $i));; - - if ($i <= $end && $i > 0) { - $expected = '...' . $expected; - $actual = '...' . $actual; - } - - if ($j < strlen($this->expected) - 1) { - $expected .= '...'; - } - - if ($k < strlen($this->actual) - 1) { - $actual .= '...'; - } - } - - return PHPUnit2_Framework_Assert::format( - $expected, - $actual, - parent::getMessage() - ); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: ComparisonFailure.php,v 1.13.2.3 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/Assert.php'; +require_once 'PHPUnit2/Framework/AssertionFailedError.php'; + +/** + * Thrown when an assertion for string equality failed. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Framework_ComparisonFailure extends PHPUnit2_Framework_AssertionFailedError { + /** + * @var string + * @access private + */ + private $expected = ''; + + /** + * @var string + * @access private + */ + private $actual = ''; + + /** + * Constructs a comparison failure. + * + * @param string $expected + * @param string $actual + * @param string $message + * @access public + */ + public function __construct($expected, $actual, $message = '') { + parent::__construct($message); + + $this->expected = ($expected === NULL) ? 'NULL' : $expected; + $this->actual = ($actual === NULL) ? 'NULL' : $actual; + } + + /** + * Returns "..." in place of common prefix and "..." in + * place of common suffix between expected and actual. + * + * @return string + * @access public + */ + public function toString() { + $end = min(strlen($this->expected), strlen($this->actual)); + $i = 0; + $j = strlen($this->expected) - 1; + $k = strlen($this->actual) - 1; + + for (; $i < $end; $i++) { + if ($this->expected[$i] != $this->actual[$i]) { + break; + } + } + + for (; $k >= $i && $j >= $i; $k--,$j--) { + if ($this->expected[$j] != $this->actual[$k]) { + break; + } + } + + if ($j < $i && $k < $i) { + $expected = $this->expected; + $actual = $this->actual; + } else { + $expected = substr($this->expected, $i, ($j + 1 - $i)); + $actual = substr($this->actual, $i, ($k + 1 - $i));; + + if ($i <= $end && $i > 0) { + $expected = '...' . $expected; + $actual = '...' . $actual; + } + + if ($j < strlen($this->expected) - 1) { + $expected .= '...'; + } + + if ($k < strlen($this->actual) - 1) { + $actual .= '...'; + } + } + + return PHPUnit2_Framework_Assert::format( + $expected, + $actual, + parent::getMessage() + ); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/Error.php b/buildscripts/PHPUnit2/Framework/Error.php index a4bd4fd2..2f3a3c16 100644 --- a/buildscripts/PHPUnit2/Framework/Error.php +++ b/buildscripts/PHPUnit2/Framework/Error.php @@ -1,88 +1,88 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Error.php,v 1.4.2.2 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.2.0 - */ - -/** - * Wrapper for PHP errors. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.2.0 - */ -class PHPUnit2_Framework_Error extends Exception { - /** - * Constructor. - * - * @param string $message - * @param integer $code - * @param string $file - * @param integer $line - * @param array $trace - * @access public - */ - public function __construct($message, $code, $file, $line, $trace) { - parent::__construct($message, $code); - - $this->file = $file; - $this->line = $line; - $this->trace = $trace; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Error.php,v 1.4.2.2 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.2.0 + */ + +/** + * Wrapper for PHP errors. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.2.0 + */ +class PHPUnit2_Framework_Error extends Exception { + /** + * Constructor. + * + * @param string $message + * @param integer $code + * @param string $file + * @param integer $line + * @param array $trace + * @access public + */ + public function __construct($message, $code, $file, $line, $trace) { + parent::__construct($message, $code); + + $this->file = $file; + $this->line = $line; + $this->trace = $trace; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/IncompleteTest.php b/buildscripts/PHPUnit2/Framework/IncompleteTest.php index 325e6411..0c0192a9 100644 --- a/buildscripts/PHPUnit2/Framework/IncompleteTest.php +++ b/buildscripts/PHPUnit2/Framework/IncompleteTest.php @@ -1,72 +1,72 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: IncompleteTest.php,v 1.6.2.2 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -/** - * A marker interface for marking any exception/error as result of an unit - * test as incomplete implementation or currently not implemented. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Interface available since Release 2.0.0 - */ -interface PHPUnit2_Framework_IncompleteTest { -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: IncompleteTest.php,v 1.6.2.2 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +/** + * A marker interface for marking any exception/error as result of an unit + * test as incomplete implementation or currently not implemented. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Interface available since Release 2.0.0 + */ +interface PHPUnit2_Framework_IncompleteTest { +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/IncompleteTestError.php b/buildscripts/PHPUnit2/Framework/IncompleteTestError.php index 6c2a0660..e0170b69 100644 --- a/buildscripts/PHPUnit2/Framework/IncompleteTestError.php +++ b/buildscripts/PHPUnit2/Framework/IncompleteTestError.php @@ -1,75 +1,75 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: IncompleteTestError.php,v 1.5.2.3 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/AssertionFailedError.php'; -require_once 'PHPUnit2/Framework/IncompleteTest.php'; - -/** - * Extension to PHPUnit2_Framework_AssertionFailedError to mark the special - * case of an incomplete test. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Framework_IncompleteTestError extends PHPUnit2_Framework_AssertionFailedError implements PHPUnit2_Framework_IncompleteTest { -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: IncompleteTestError.php,v 1.5.2.3 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/AssertionFailedError.php'; +require_once 'PHPUnit2/Framework/IncompleteTest.php'; + +/** + * Extension to PHPUnit2_Framework_AssertionFailedError to mark the special + * case of an incomplete test. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Framework_IncompleteTestError extends PHPUnit2_Framework_AssertionFailedError implements PHPUnit2_Framework_IncompleteTest { +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/Test.php b/buildscripts/PHPUnit2/Framework/Test.php index 1d198f1a..f0b98dc7 100644 --- a/buildscripts/PHPUnit2/Framework/Test.php +++ b/buildscripts/PHPUnit2/Framework/Test.php @@ -1,87 +1,87 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Test.php,v 1.12.2.3 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -/** - * A Test can be run and collect its results. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Interface available since Release 2.0.0 - */ -interface PHPUnit2_Framework_Test { - /** - * Counts the number of test cases that will be run by this test. - * - * @return integer - * @access public - */ - public function countTestCases(); - - /** - * Runs a test and collects its result in a TestResult instance. - * - * @param PHPUnit2_Framework_TestResult $result - * @return PHPUnit2_Framework_TestResult - * @access public - */ - public function run($result = NULL); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Test.php,v 1.12.2.3 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +/** + * A Test can be run and collect its results. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Interface available since Release 2.0.0 + */ +interface PHPUnit2_Framework_Test { + /** + * Counts the number of test cases that will be run by this test. + * + * @return integer + * @access public + */ + public function countTestCases(); + + /** + * Runs a test and collects its result in a TestResult instance. + * + * @param PHPUnit2_Framework_TestResult $result + * @return PHPUnit2_Framework_TestResult + * @access public + */ + public function run($result = NULL); +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/TestCase.php b/buildscripts/PHPUnit2/Framework/TestCase.php index 80f56932..b8e6a22e 100644 --- a/buildscripts/PHPUnit2/Framework/TestCase.php +++ b/buildscripts/PHPUnit2/Framework/TestCase.php @@ -1,292 +1,292 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestCase.php,v 1.32.2.5 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/Assert.php'; -require_once 'PHPUnit2/Framework/Error.php'; -require_once 'PHPUnit2/Framework/Test.php'; -require_once 'PHPUnit2/Framework/TestResult.php'; - -/** - * A TestCase defines the fixture to run multiple tests. - * - * To define a TestCase - * - * 1) Implement a subclass of PHPUnit2_Framework_TestCase. - * 2) Define instance variables that store the state of the fixture. - * 3) Initialize the fixture state by overriding setUp(). - * 4) Clean-up after a test by overriding tearDown(). - * - * Each test runs in its own fixture so there can be no side effects - * among test runs. - * - * Here is an example: - * - * - * value1 = 2; - * $this->value2 = 3; - * } - * } - * ?> - * - * - * For each test implement a method which interacts with the fixture. - * Verify the expected results with assertions specified by calling - * assert with a boolean. - * - * - * assertTrue($this->value1 + $this->value2 == 5); - * } - * ?> - * - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - * @abstract - */ -abstract class PHPUnit2_Framework_TestCase extends PHPUnit2_Framework_Assert implements PHPUnit2_Framework_Test { - /** - * The name of the test case. - * - * @var string - * @access private - */ - private $name = NULL; - - /** - * Constructs a test case with the given name. - * - * @param string - * @access public - */ - public function __construct($name = NULL) { - if ($name !== NULL) { - $this->setName($name); - } - } - - /** - * Returns a string representation of the test case. - * - * @return string - * @access public - */ - public function toString() { - $class = new ReflectionClass($this); - - return sprintf( - '%s(%s)', - - $this->getName(), - $class->name - ); - } - - /** - * Counts the number of test cases executed by run(TestResult result). - * - * @return integer - * @access public - */ - public function countTestCases() { - return 1; - } - - /** - * Gets the name of a TestCase. - * - * @return string - * @access public - */ - public function getName() { - return $this->name; - } - - /** - * Runs the test case and collects the results in a TestResult object. - * If no TestResult object is passed a new one will be created. - * - * @param PHPUnit2_Framework_TestResult $result - * @return PHPUnit2_Framework_TestResult - * @throws Exception - * @access public - */ - public function run($result = NULL) { - if ($result === NULL) { - $result = $this->createResult(); - } - - // XXX: Workaround for missing ability to declare type-hinted parameters as optional. - else if (!($result instanceof PHPUnit2_Framework_TestResult)) { - throw new Exception( - 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' - ); - } - - $result->run($this); - - return $result; - } - - /** - * Runs the bare test sequence. - * - * @access public - */ - public function runBare() { - $catchedException = NULL; - - $this->setUp(); - - try { - $this->runTest(); - } - - catch (Exception $e) { - $catchedException = $e; - } - - $this->tearDown(); - - // Workaround for missing "finally". - if ($catchedException !== NULL) { - throw $catchedException; - } - } - - /** - * Override to run the test and assert its state. - * - * @throws PHPUnit2_Framework_Error - * @access protected - */ - protected function runTest() { - if ($this->name === NULL) { - throw new PHPUnit2_Framework_Error( - 'PHPUnit2_Framework_TestCase::$name must not be NULL.' - ); - } - - try { - $class = new ReflectionClass($this); - $method = $class->getMethod($this->name); - } - - catch (ReflectionException $e) { - $this->fail($e->getMessage()); - } - - $method->invoke($this); - } - - /** - * Sets the name of a TestCase. - * - * @param string - * @access public - */ - public function setName($name) { - $this->name = $name; - } - - /** - * Creates a default TestResult object. - * - * @return PHPUnit2_Framework_TestResult - * @access protected - */ - protected function createResult() { - return new PHPUnit2_Framework_TestResult; - } - - /** - * Sets up the fixture, for example, open a network connection. - * This method is called before a test is executed. - * - * @access protected - */ - protected function setUp() { - } - - /** - * Tears down the fixture, for example, close a network connection. - * This method is called after a test is executed. - * - * @access protected - */ - protected function tearDown() { - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestCase.php,v 1.32.2.5 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/Assert.php'; +require_once 'PHPUnit2/Framework/Error.php'; +require_once 'PHPUnit2/Framework/Test.php'; +require_once 'PHPUnit2/Framework/TestResult.php'; + +/** + * A TestCase defines the fixture to run multiple tests. + * + * To define a TestCase + * + * 1) Implement a subclass of PHPUnit2_Framework_TestCase. + * 2) Define instance variables that store the state of the fixture. + * 3) Initialize the fixture state by overriding setUp(). + * 4) Clean-up after a test by overriding tearDown(). + * + * Each test runs in its own fixture so there can be no side effects + * among test runs. + * + * Here is an example: + * + * + * value1 = 2; + * $this->value2 = 3; + * } + * } + * ?> + * + * + * For each test implement a method which interacts with the fixture. + * Verify the expected results with assertions specified by calling + * assert with a boolean. + * + * + * assertTrue($this->value1 + $this->value2 == 5); + * } + * ?> + * + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + * @abstract + */ +abstract class PHPUnit2_Framework_TestCase extends PHPUnit2_Framework_Assert implements PHPUnit2_Framework_Test { + /** + * The name of the test case. + * + * @var string + * @access private + */ + private $name = NULL; + + /** + * Constructs a test case with the given name. + * + * @param string + * @access public + */ + public function __construct($name = NULL) { + if ($name !== NULL) { + $this->setName($name); + } + } + + /** + * Returns a string representation of the test case. + * + * @return string + * @access public + */ + public function toString() { + $class = new ReflectionClass($this); + + return sprintf( + '%s(%s)', + + $this->getName(), + $class->name + ); + } + + /** + * Counts the number of test cases executed by run(TestResult result). + * + * @return integer + * @access public + */ + public function countTestCases() { + return 1; + } + + /** + * Gets the name of a TestCase. + * + * @return string + * @access public + */ + public function getName() { + return $this->name; + } + + /** + * Runs the test case and collects the results in a TestResult object. + * If no TestResult object is passed a new one will be created. + * + * @param PHPUnit2_Framework_TestResult $result + * @return PHPUnit2_Framework_TestResult + * @throws Exception + * @access public + */ + public function run($result = NULL) { + if ($result === NULL) { + $result = $this->createResult(); + } + + // XXX: Workaround for missing ability to declare type-hinted parameters as optional. + else if (!($result instanceof PHPUnit2_Framework_TestResult)) { + throw new Exception( + 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' + ); + } + + $result->run($this); + + return $result; + } + + /** + * Runs the bare test sequence. + * + * @access public + */ + public function runBare() { + $catchedException = NULL; + + $this->setUp(); + + try { + $this->runTest(); + } + + catch (Exception $e) { + $catchedException = $e; + } + + $this->tearDown(); + + // Workaround for missing "finally". + if ($catchedException !== NULL) { + throw $catchedException; + } + } + + /** + * Override to run the test and assert its state. + * + * @throws PHPUnit2_Framework_Error + * @access protected + */ + protected function runTest() { + if ($this->name === NULL) { + throw new PHPUnit2_Framework_Error( + 'PHPUnit2_Framework_TestCase::$name must not be NULL.' + ); + } + + try { + $class = new ReflectionClass($this); + $method = $class->getMethod($this->name); + } + + catch (ReflectionException $e) { + $this->fail($e->getMessage()); + } + + $method->invoke($this); + } + + /** + * Sets the name of a TestCase. + * + * @param string + * @access public + */ + public function setName($name) { + $this->name = $name; + } + + /** + * Creates a default TestResult object. + * + * @return PHPUnit2_Framework_TestResult + * @access protected + */ + protected function createResult() { + return new PHPUnit2_Framework_TestResult; + } + + /** + * Sets up the fixture, for example, open a network connection. + * This method is called before a test is executed. + * + * @access protected + */ + protected function setUp() { + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + * + * @access protected + */ + protected function tearDown() { + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/TestFailure.php b/buildscripts/PHPUnit2/Framework/TestFailure.php index 4957e4e6..848fbfa1 100644 --- a/buildscripts/PHPUnit2/Framework/TestFailure.php +++ b/buildscripts/PHPUnit2/Framework/TestFailure.php @@ -1,154 +1,154 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestFailure.php,v 1.10.2.3 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/AssertionFailedError.php'; -require_once 'PHPUnit2/Framework/Test.php'; - -/** - * A TestFailure collects a failed test together with the caught exception. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Framework_TestFailure { - /** - * @var PHPUnit2_Framework_Test - * @access protected - */ - protected $failedTest; - - /** - * @var Exception - * @access protected - */ - protected $thrownException; - - /** - * Constructs a TestFailure with the given test and exception. - * - * @param PHPUnit2_Framework_Test $failedTest - * @param Exception $thrownException - * @access public - */ - public function __construct(PHPUnit2_Framework_Test $failedTest, Exception $thrownException) { - $this->failedTest = $failedTest; - $this->thrownException = $thrownException; - } - - /** - * Returns a short description of the failure. - * - * @return string - * @access public - */ - public function toString() { - return sprintf( - '%s: %s', - - $this->failedTest, - $this->thrownException->getMessage() - ); - } - - /** - * Gets the failed test. - * - * @return Test - * @access public - */ - public function failedTest() { - return $this->failedTest; - } - - /** - * Gets the thrown exception. - * - * @return Exception - * @access public - */ - public function thrownException() { - return $this->thrownException; - } - - /** - * Returns the exception's message. - * - * @return string - * @access public - */ - public function exceptionMessage() { - return $this->thrownException()->getMessage(); - } - - /** - * Returns TRUE if the thrown exception - * is of type AssertionFailedError. - * - * @return boolean - * @access public - */ - public function isFailure() { - return ($this->thrownException() instanceof PHPUnit2_Framework_AssertionFailedError); - } -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestFailure.php,v 1.10.2.3 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/AssertionFailedError.php'; +require_once 'PHPUnit2/Framework/Test.php'; + +/** + * A TestFailure collects a failed test together with the caught exception. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Framework_TestFailure { + /** + * @var PHPUnit2_Framework_Test + * @access protected + */ + protected $failedTest; + + /** + * @var Exception + * @access protected + */ + protected $thrownException; + + /** + * Constructs a TestFailure with the given test and exception. + * + * @param PHPUnit2_Framework_Test $failedTest + * @param Exception $thrownException + * @access public + */ + public function __construct(PHPUnit2_Framework_Test $failedTest, Exception $thrownException) { + $this->failedTest = $failedTest; + $this->thrownException = $thrownException; + } + + /** + * Returns a short description of the failure. + * + * @return string + * @access public + */ + public function toString() { + return sprintf( + '%s: %s', + + $this->failedTest, + $this->thrownException->getMessage() + ); + } + + /** + * Gets the failed test. + * + * @return Test + * @access public + */ + public function failedTest() { + return $this->failedTest; + } + + /** + * Gets the thrown exception. + * + * @return Exception + * @access public + */ + public function thrownException() { + return $this->thrownException; + } + + /** + * Returns the exception's message. + * + * @return string + * @access public + */ + public function exceptionMessage() { + return $this->thrownException()->getMessage(); + } + + /** + * Returns TRUE if the thrown exception + * is of type AssertionFailedError. + * + * @return boolean + * @access public + */ + public function isFailure() { + return ($this->thrownException() instanceof PHPUnit2_Framework_AssertionFailedError); + } +} + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/TestListener.php b/buildscripts/PHPUnit2/Framework/TestListener.php index 79f11ffb..5a4dcb1a 100644 --- a/buildscripts/PHPUnit2/Framework/TestListener.php +++ b/buildscripts/PHPUnit2/Framework/TestListener.php @@ -1,135 +1,135 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestListener.php,v 1.11.2.3 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/AssertionFailedError.php'; -require_once 'PHPUnit2/Framework/TestSuite.php'; - -/** - * A Listener for test progress. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Interface available since Release 2.0.0 - */ -interface PHPUnit2_Framework_TestListener { - /** - * An error occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addError(PHPUnit2_Framework_Test $test, Exception $e); - - /** - * A failure occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_AssertionFailedError $e - * @access public - */ - public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e); - - /** - * Incomplete test. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e); - - /** - * A test suite started. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function startTestSuite(PHPUnit2_Framework_TestSuite $suite); - - /** - * A test suite ended. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function endTestSuite(PHPUnit2_Framework_TestSuite $suite); - - /** - * A test started. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function startTest(PHPUnit2_Framework_Test $test); - - /** - * A test ended. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function endTest(PHPUnit2_Framework_Test $test); -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestListener.php,v 1.11.2.3 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/AssertionFailedError.php'; +require_once 'PHPUnit2/Framework/TestSuite.php'; + +/** + * A Listener for test progress. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Interface available since Release 2.0.0 + */ +interface PHPUnit2_Framework_TestListener { + /** + * An error occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addError(PHPUnit2_Framework_Test $test, Exception $e); + + /** + * A failure occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_AssertionFailedError $e + * @access public + */ + public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e); + + /** + * Incomplete test. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e); + + /** + * A test suite started. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit2_Framework_TestSuite $suite); + + /** + * A test suite ended. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit2_Framework_TestSuite $suite); + + /** + * A test started. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function startTest(PHPUnit2_Framework_Test $test); + + /** + * A test ended. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function endTest(PHPUnit2_Framework_Test $test); +} + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/TestResult.php b/buildscripts/PHPUnit2/Framework/TestResult.php index 17adb529..0cb854c7 100644 --- a/buildscripts/PHPUnit2/Framework/TestResult.php +++ b/buildscripts/PHPUnit2/Framework/TestResult.php @@ -1,447 +1,447 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestResult.php,v 1.32.2.7 2006/02/25 09:44:23 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/AssertionFailedError.php'; -require_once 'PHPUnit2/Framework/IncompleteTest.php'; -require_once 'PHPUnit2/Framework/TestFailure.php'; -require_once 'PHPUnit2/Framework/TestListener.php'; -require_once 'PHPUnit2/Util/ErrorHandler.php'; -require_once 'PHPUnit2/Util/Filter.php'; - -/** - * A TestResult collects the results of executing a test case. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Framework_TestResult { - /** - * @var array - * @access protected - */ - protected $errors = array(); - - /** - * @var array - * @access protected - */ - protected $failures = array(); - - /** - * @var array - * @access protected - */ - protected $notImplemented = array(); - - /** - * @var array - * @access protected - */ - protected $listeners = array(); - - /** - * @var integer - * @access protected - */ - protected $runTests = 0; - - /** - * Code Coverage information provided by Xdebug. - * - * @var array - * @access protected - */ - protected $codeCoverageInformation = array(); - - /** - * @var boolean - * @access protected - */ - protected $collectCodeCoverageInformation = FALSE; - - /** - * @var boolean - * @access private - */ - private $stop = FALSE; - - /** - * Registers a TestListener. - * - * @param PHPUnit2_Framework_TestListener - * @access public - */ - public function addListener(PHPUnit2_Framework_TestListener $listener) { - $this->listeners[] = $listener; - } - - /** - * Unregisters a TestListener. - * - * @param PHPUnit2_Framework_TestListener $listener - * @access public - */ - public function removeListener(PHPUnit2_Framework_TestListener $listener) { - for ($i = 0; $i < sizeof($this->listeners); $i++) { - if ($this->listeners[$i] === $listener) { - unset($this->listeners[$i]); - } - } - } - - /** - * Adds an error to the list of errors. - * The passed in exception caused the error. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addError(PHPUnit2_Framework_Test $test, Exception $e) { - if ($e instanceof PHPUnit2_Framework_IncompleteTest) { - $this->notImplemented[] = new PHPUnit2_Framework_TestFailure($test, $e); - - foreach ($this->listeners as $listener) { - $listener->addIncompleteTest($test, $e); - } - } else { - $this->errors[] = new PHPUnit2_Framework_TestFailure($test, $e); - - foreach ($this->listeners as $listener) { - $listener->addError($test, $e); - } - } - } - - /** - * Adds a failure to the list of failures. - * The passed in exception caused the failure. - * - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_AssertionFailedError $e - * @access public - */ - public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { - if ($e instanceof PHPUnit2_Framework_IncompleteTest) { - $this->notImplemented[] = new PHPUnit2_Framework_TestFailure($test, $e); - - foreach ($this->listeners as $listener) { - $listener->addIncompleteTest($test, $e); - } - } else { - $this->failures[] = new PHPUnit2_Framework_TestFailure($test, $e); - - foreach ($this->listeners as $listener) { - $listener->addFailure($test, $e); - } - } - } - - /** - * Informs the result that a testsuite will be started. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { - foreach ($this->listeners as $listener) { - $listener->startTestSuite($suite); - } - } - - /** - * Informs the result that a testsuite was completed. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { - foreach ($this->listeners as $listener) { - $listener->endTestSuite($suite); - } - } - - /** - * Informs the result that a test will be started. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function startTest(PHPUnit2_Framework_Test $test) { - $this->runTests += $test->countTestCases(); - - foreach ($this->listeners as $listener) { - $listener->startTest($test); - } - } - - /** - * Informs the result that a test was completed. - * - * @param PHPUnit2_Framework_Test - * @access public - */ - public function endTest(PHPUnit2_Framework_Test $test) { - foreach ($this->listeners as $listener) { - $listener->endTest($test); - } - } - - /** - * Returns TRUE if no incomplete test occured. - * - * @return boolean - * @access public - */ - public function allCompletlyImplemented() { - return $this->notImplementedCount() == 0; - } - - /** - * Gets the number of incomplete tests. - * - * @return integer - * @access public - */ - public function notImplementedCount() { - return sizeof($this->notImplemented); - } - - /** - * Returns an Enumeration for the incomplete tests. - * - * @return array - * @access public - */ - public function notImplemented() { - return $this->notImplemented; - } - - /** - * Gets the number of detected errors. - * - * @return integer - * @access public - */ - public function errorCount() { - return sizeof($this->errors); - } - - /** - * Returns an Enumeration for the errors. - * - * @return array - * @access public - */ - public function errors() { - return $this->errors; - } - - /** - * Gets the number of detected failures. - * - * @return integer - * @access public - */ - public function failureCount() { - return sizeof($this->failures); - } - - /** - * Returns an Enumeration for the failures. - * - * @return array - * @access public - */ - public function failures() { - return $this->failures; - } - - /** - * Enables or disables the collection of Code Coverage information. - * - * @param boolean $flag - * @throws Exception - * @access public - * @since Method available since Release 2.3.0 - */ - public function collectCodeCoverageInformation($flag) { - if (is_bool($flag)) { - $this->collectCodeCoverageInformation = $flag; - } else { - throw new Exception; - } - } - - /** - * Returns Code Coverage data per test case. - * - * Format of the result array: - * - * - * array( - * "testCase" => array( - * "/tested/code.php" => array( - * linenumber => flag - * ) - * ) - * ) - * - * - * flag < 0: Line is executable but was not executed. - * flag > 0: Line was executed. - * - * @return array - * @access public - */ - public function getCodeCoverageInformation() { - return $this->codeCoverageInformation; - } - - /** - * Runs a TestCase. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function run(PHPUnit2_Framework_Test $test) { - $this->startTest($test); - - set_error_handler('PHPUnit2_Util_ErrorHandler', E_USER_ERROR); - - $useXdebug = (extension_loaded('xdebug') && $this->collectCodeCoverageInformation); - - if ($useXdebug) { - xdebug_start_code_coverage(XDEBUG_CC_UNUSED); - } - - $globalsBackup = $GLOBALS; - - try { - $test->runBare(); - } - - catch (PHPUnit2_Framework_AssertionFailedError $e) { - $this->addFailure($test, $e); - } - - catch (Exception $e) { - $this->addError($test, $e); - } - - $GLOBALS = $globalsBackup; - - if ($useXdebug) { - $this->codeCoverageInformation[$test->getName()] = PHPUnit2_Util_Filter::getFilteredCodeCoverage( - xdebug_get_code_coverage() - ); - - xdebug_stop_code_coverage(); - } - - restore_error_handler(); - - $this->endTest($test); - } - - /** - * Gets the number of run tests. - * - * @return integer - * @access public - */ - public function runCount() { - return $this->runTests; - } - - /** - * Checks whether the test run should stop. - * - * @return boolean - * @access public - */ - public function shouldStop() { - return $this->stop; - } - - /** - * Marks that the test run should stop. - * - * @access public - */ - public function stop() { - $this->stop = TRUE; - } - - /** - * Returns whether the entire test was successful or not. - * - * @return boolean - * @access public - */ - public function wasSuccessful() { - return empty($this->errors) && empty($this->failures); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestResult.php,v 1.32.2.7 2006/02/25 09:44:23 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/AssertionFailedError.php'; +require_once 'PHPUnit2/Framework/IncompleteTest.php'; +require_once 'PHPUnit2/Framework/TestFailure.php'; +require_once 'PHPUnit2/Framework/TestListener.php'; +require_once 'PHPUnit2/Util/ErrorHandler.php'; +require_once 'PHPUnit2/Util/Filter.php'; + +/** + * A TestResult collects the results of executing a test case. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Framework_TestResult { + /** + * @var array + * @access protected + */ + protected $errors = array(); + + /** + * @var array + * @access protected + */ + protected $failures = array(); + + /** + * @var array + * @access protected + */ + protected $notImplemented = array(); + + /** + * @var array + * @access protected + */ + protected $listeners = array(); + + /** + * @var integer + * @access protected + */ + protected $runTests = 0; + + /** + * Code Coverage information provided by Xdebug. + * + * @var array + * @access protected + */ + protected $codeCoverageInformation = array(); + + /** + * @var boolean + * @access protected + */ + protected $collectCodeCoverageInformation = FALSE; + + /** + * @var boolean + * @access private + */ + private $stop = FALSE; + + /** + * Registers a TestListener. + * + * @param PHPUnit2_Framework_TestListener + * @access public + */ + public function addListener(PHPUnit2_Framework_TestListener $listener) { + $this->listeners[] = $listener; + } + + /** + * Unregisters a TestListener. + * + * @param PHPUnit2_Framework_TestListener $listener + * @access public + */ + public function removeListener(PHPUnit2_Framework_TestListener $listener) { + for ($i = 0; $i < sizeof($this->listeners); $i++) { + if ($this->listeners[$i] === $listener) { + unset($this->listeners[$i]); + } + } + } + + /** + * Adds an error to the list of errors. + * The passed in exception caused the error. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addError(PHPUnit2_Framework_Test $test, Exception $e) { + if ($e instanceof PHPUnit2_Framework_IncompleteTest) { + $this->notImplemented[] = new PHPUnit2_Framework_TestFailure($test, $e); + + foreach ($this->listeners as $listener) { + $listener->addIncompleteTest($test, $e); + } + } else { + $this->errors[] = new PHPUnit2_Framework_TestFailure($test, $e); + + foreach ($this->listeners as $listener) { + $listener->addError($test, $e); + } + } + } + + /** + * Adds a failure to the list of failures. + * The passed in exception caused the failure. + * + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_AssertionFailedError $e + * @access public + */ + public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { + if ($e instanceof PHPUnit2_Framework_IncompleteTest) { + $this->notImplemented[] = new PHPUnit2_Framework_TestFailure($test, $e); + + foreach ($this->listeners as $listener) { + $listener->addIncompleteTest($test, $e); + } + } else { + $this->failures[] = new PHPUnit2_Framework_TestFailure($test, $e); + + foreach ($this->listeners as $listener) { + $listener->addFailure($test, $e); + } + } + } + + /** + * Informs the result that a testsuite will be started. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { + foreach ($this->listeners as $listener) { + $listener->startTestSuite($suite); + } + } + + /** + * Informs the result that a testsuite was completed. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { + foreach ($this->listeners as $listener) { + $listener->endTestSuite($suite); + } + } + + /** + * Informs the result that a test will be started. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function startTest(PHPUnit2_Framework_Test $test) { + $this->runTests += $test->countTestCases(); + + foreach ($this->listeners as $listener) { + $listener->startTest($test); + } + } + + /** + * Informs the result that a test was completed. + * + * @param PHPUnit2_Framework_Test + * @access public + */ + public function endTest(PHPUnit2_Framework_Test $test) { + foreach ($this->listeners as $listener) { + $listener->endTest($test); + } + } + + /** + * Returns TRUE if no incomplete test occured. + * + * @return boolean + * @access public + */ + public function allCompletlyImplemented() { + return $this->notImplementedCount() == 0; + } + + /** + * Gets the number of incomplete tests. + * + * @return integer + * @access public + */ + public function notImplementedCount() { + return sizeof($this->notImplemented); + } + + /** + * Returns an Enumeration for the incomplete tests. + * + * @return array + * @access public + */ + public function notImplemented() { + return $this->notImplemented; + } + + /** + * Gets the number of detected errors. + * + * @return integer + * @access public + */ + public function errorCount() { + return sizeof($this->errors); + } + + /** + * Returns an Enumeration for the errors. + * + * @return array + * @access public + */ + public function errors() { + return $this->errors; + } + + /** + * Gets the number of detected failures. + * + * @return integer + * @access public + */ + public function failureCount() { + return sizeof($this->failures); + } + + /** + * Returns an Enumeration for the failures. + * + * @return array + * @access public + */ + public function failures() { + return $this->failures; + } + + /** + * Enables or disables the collection of Code Coverage information. + * + * @param boolean $flag + * @throws Exception + * @access public + * @since Method available since Release 2.3.0 + */ + public function collectCodeCoverageInformation($flag) { + if (is_bool($flag)) { + $this->collectCodeCoverageInformation = $flag; + } else { + throw new Exception; + } + } + + /** + * Returns Code Coverage data per test case. + * + * Format of the result array: + * + * + * array( + * "testCase" => array( + * "/tested/code.php" => array( + * linenumber => flag + * ) + * ) + * ) + * + * + * flag < 0: Line is executable but was not executed. + * flag > 0: Line was executed. + * + * @return array + * @access public + */ + public function getCodeCoverageInformation() { + return $this->codeCoverageInformation; + } + + /** + * Runs a TestCase. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function run(PHPUnit2_Framework_Test $test) { + $this->startTest($test); + + set_error_handler('PHPUnit2_Util_ErrorHandler', E_USER_ERROR); + + $useXdebug = (extension_loaded('xdebug') && $this->collectCodeCoverageInformation); + + if ($useXdebug) { + xdebug_start_code_coverage(XDEBUG_CC_UNUSED); + } + + $globalsBackup = $GLOBALS; + + try { + $test->runBare(); + } + + catch (PHPUnit2_Framework_AssertionFailedError $e) { + $this->addFailure($test, $e); + } + + catch (Exception $e) { + $this->addError($test, $e); + } + + $GLOBALS = $globalsBackup; + + if ($useXdebug) { + $this->codeCoverageInformation[$test->getName()] = PHPUnit2_Util_Filter::getFilteredCodeCoverage( + xdebug_get_code_coverage() + ); + + xdebug_stop_code_coverage(); + } + + restore_error_handler(); + + $this->endTest($test); + } + + /** + * Gets the number of run tests. + * + * @return integer + * @access public + */ + public function runCount() { + return $this->runTests; + } + + /** + * Checks whether the test run should stop. + * + * @return boolean + * @access public + */ + public function shouldStop() { + return $this->stop; + } + + /** + * Marks that the test run should stop. + * + * @access public + */ + public function stop() { + $this->stop = TRUE; + } + + /** + * Returns whether the entire test was successful or not. + * + * @return boolean + * @access public + */ + public function wasSuccessful() { + return empty($this->errors) && empty($this->failures); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/TestSuite.php b/buildscripts/PHPUnit2/Framework/TestSuite.php index 3d5d670e..12c4ce5a 100644 --- a/buildscripts/PHPUnit2/Framework/TestSuite.php +++ b/buildscripts/PHPUnit2/Framework/TestSuite.php @@ -1,554 +1,554 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestSuite.php,v 1.26.2.11 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/Test.php'; -require_once 'PHPUnit2/Framework/TestCase.php'; -require_once 'PHPUnit2/Framework/TestResult.php'; -require_once 'PHPUnit2/Runner/BaseTestRunner.php'; -require_once 'PHPUnit2/Util/Fileloader.php'; - -/** - * A TestSuite is a composite of Tests. It runs a collection of test cases. - * - * Here is an example using the dynamic test definition. - * - * - * addTest(new MathTest('testPass')); - * ?> - * - * - * Alternatively, a TestSuite can extract the tests to be run automatically. - * To do so you pass a ReflectionClass instance for your - * PHPUnit2_Framework_TestCase class to the PHPUnit2_Framework_TestSuite - * constructor. - * - * - * - * - * - * This constructor creates a suite with all the methods starting with - * "test" that take no arguments. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Framework_TestSuite implements PHPUnit2_Framework_Test { - /** - * The name of the test suite. - * - * @var string - * @access private - */ - private $name = ''; - - /** - * The tests in the test suite. - * - * @var array - * @access private - */ - private $tests = array(); - - /** - * Constructs a new TestSuite: - * - * - PHPUnit2_Framework_TestSuite() constructs an empty TestSuite. - * - * - PHPUnit2_Framework_TestSuite(ReflectionClass) constructs a - * TestSuite from the given class. - * - * - PHPUnit2_Framework_TestSuite(ReflectionClass, String) - * constructs a TestSuite from the given class with the given - * name. - * - * - PHPUnit2_Framework_TestSuite(String) either constructs a - * TestSuite from the given class (if the passed string is the - * name of an existing class) or constructs an empty TestSuite - * with the given name. - * - * @param mixed $theClass - * @param string $name - * @throws Exception - * @access public - */ - public function __construct($theClass = '', $name = '') { - $argumentsValid = FALSE; - - if (is_object($theClass) && - $theClass instanceof ReflectionClass) { - $argumentsValid = TRUE; - } - - else if (is_string($theClass) && $theClass !== '' && class_exists($theClass)) { - $argumentsValid = TRUE; - - if ($name == '') { - $name = $theClass; - } - - $theClass = new ReflectionClass($theClass); - } - - else if (is_string($theClass)) { - $this->setName($theClass); - return; - } - - if (!$argumentsValid) { - throw new Exception; - } - - if ($name != '') { - $this->setName($name); - } else { - $this->setName($theClass->getName()); - } - - $constructor = $theClass->getConstructor(); - - if ($constructor === NULL || - !$constructor->isPublic()) { - $this->addTest( - self::warning( - sprintf( - 'Class %s has no public constructor', - - $theClass->getName() - ) - ) - ); - - return; - } - - $methods = $theClass->getMethods(); - $names = array(); - - foreach ($methods as $method) { - $this->addTestMethod($method, $names, $theClass); - } - - if (empty($this->tests)) { - $this->addTest( - self::warning( - sprintf( - 'No tests found in %s', - - $theClass->getName() - ) - ) - ); - } - } - - /** - * Returns a string representation of the test suite. - * - * @return string - * @access public - */ - public function toString() { - return $this->getName(); - } - - /** - * Adds a test to the suite. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function addTest(PHPUnit2_Framework_Test $test) { - $this->tests[] = $test; - } - - /** - * Adds the tests from the given class to the suite. - * - * @param mixed $testClass - * @access public - */ - public function addTestSuite($testClass) { - if (is_string($testClass) && - class_exists($testClass)) { - $testClass = new ReflectionClass($testClass); - } - - if (is_object($testClass) && - $testClass instanceof ReflectionClass) { - $this->addTest(new PHPUnit2_Framework_TestSuite($testClass)); - } - } - - /** - * Wraps both addTest() and addTestSuite - * as well as the separate import statements for the user's convenience. - * - * If the named file cannot be read or there are no new tests that can be - * added, a PHPUnit2_Framework_Warning will be created instead, - * leaving the current test run untouched. - * - * @param string $filename - * @throws Exception - * @access public - * @since Method available since Release 2.3.0 - * @author Stefano F. Rausch - */ - public function addTestFile($filename) { - if (!is_string($filename) || !file_exists($filename)) { - throw new Exception; - } - - $declaredClasses = get_declared_classes(); - - PHPUnit2_Util_Fileloader::checkAndLoad($filename); - - $newClasses = array_values( - array_diff(get_declared_classes(), $declaredClasses) - ); - - $testsFound = 0; - - foreach ($newClasses as $class) { - if (preg_match('"Tests?$"', $class)) { - try { - $suiteMethod = new ReflectionMethod( - $class, PHPUnit2_Runner_BaseTestRunner::SUITE_METHODNAME - ); - - $this->addTest($suiteMethod->invoke(NULL)); - } catch (ReflectionException $e) { - $this->addTestSuite(new ReflectionClass($class)); - } - - $testsFound++; - } - } - - if ($testsFound == 0) { - $this->addTest( - new PHPUnit2_Framework_Warning('No tests found in file ' . $filename) - ); - } - } - - /** - * Wrapper for addTestFile() that adds multiple test files. - * - * @param Array $filenames - * @throws Exception - * @access public - * @since Method available since Release 2.3.0 - */ - public function addTestFiles($filenames) { - foreach ($filenames as $filename) { - $this->addTestFile($filename); - } - } - - /** - * Counts the number of test cases that will be run by this test. - * - * @return integer - * @access public - */ - public function countTestCases() { - $count = 0; - - foreach ($this->tests as $test) { - $count += $test->countTestCases(); - } - - return $count; - } - - /** - * @param ReflectionClass $theClass - * @param string $name - * @return PHPUnit2_Framework_Test - * @access public - * @static - */ - public static function createTest(ReflectionClass $theClass, $name) { - if (!$theClass->isInstantiable()) { - return self::warning( - sprintf( - 'Cannot instantiate test case %s.', - $theClass->getName() - ) - ); - } - - $constructor = $theClass->getConstructor(); - - if ($constructor !== NULL) { - $parameters = $constructor->getParameters(); - - if (sizeof($parameters) == 0) { - $test = $theClass->newInstance(); - - if ($test instanceof PHPUnit2_Framework_TestCase) { - $test->setName($name); - } - } - - else if (sizeof($parameters) == 1 && - $parameters[0]->getClass() === NULL) { - $test = $theClass->newInstance($name); - } - - else { - return self::warning( - sprintf( - 'Constructor of class %s is not TestCase($name) or TestCase().', - $theClass->getName() - ) - ); - } - } - - return $test; - } - - /** - * Creates a default TestResult object. - * - * @return PHPUnit2_Framework_TestResult - * @access protected - */ - protected function createResult() { - return new PHPUnit2_Framework_TestResult; - } - - /** - * Returns the name of the suite. - * - * @return string - * @access public - */ - public function getName() { - return $this->name; - } - - /** - * Runs the tests and collects their result in a TestResult. - * - * @param PHPUnit2_Framework_TestResult $result - * @return PHPUnit2_Framework_TestResult - * @throws Exception - * @access public - */ - public function run($result = NULL) { - if ($result === NULL) { - $result = $this->createResult(); - } - - // XXX: Workaround for missing ability to declare type-hinted parameters as optional. - else if (!($result instanceof PHPUnit2_Framework_TestResult)) { - throw new Exception( - 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' - ); - } - - $result->startTestSuite($this); - - foreach ($this->tests as $test) { - if ($result->shouldStop()) { - break; - } - - $this->runTest($test, $result); - } - - $result->endTestSuite($this); - - return $result; - } - - /** - * Runs a test. - * - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_TestResult $testResult - * @access public - */ - public function runTest(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_TestResult $result) { - $test->run($result); - } - - /** - * Sets the name of the suite. - * - * @param string - * @access public - */ - public function setName($name) { - $this->name = $name; - } - - /** - * Returns the test at the given index. - * - * @param integer - * @return PHPUnit2_Framework_Test - * @access public - */ - public function testAt($index) { - if (isset($this->tests[$index])) { - return $this->tests[$index]; - } else { - return FALSE; - } - } - - /** - * Returns the number of tests in this suite. - * - * @return integer - * @access public - */ - public function testCount() { - return sizeof($this->tests); - } - - /** - * Returns the tests as an enumeration. - * - * @return array - * @access public - */ - public function tests() { - return $this->tests; - } - - /** - * @param ReflectionMethod $method - * @param array $names - * @param ReflectionClass $theClass - * @access private - */ - private function addTestMethod(ReflectionMethod $method, &$names, ReflectionClass $theClass) { - $name = $method->getName(); - - if (in_array($name, $names)) { - return; - } - - if ($this->isPublicTestMethod($method)) { - $names[] = $name; - - $this->addTest( - self::createTest( - $theClass, - $name - ) - ); - } - - else if ($this->isTestMethod($method)) { - $this->addTest( - self::warning( - sprintf( - 'Test method is not public: %s', - - $name - ) - ) - ); - } - } - - /** - * @param ReflectionMethod $method - * @return boolean - * @access private - */ - private function isPublicTestMethod(ReflectionMethod $method) { - return ($this->isTestMethod($method) && - $method->isPublic()); - } - - /** - * @param ReflectionMethod $method - * @return boolean - * @access private - */ - private function isTestMethod(ReflectionMethod $method) { - return (substr($method->name, 0, 4) == 'test'); - } - - /** - * @param string $message - * @return PHPUnit2_Framework_Warning - * @access private - */ - private static function warning($message) { - require_once 'PHPUnit2/Framework/Warning.php'; - return new PHPUnit2_Framework_Warning($message); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestSuite.php,v 1.26.2.11 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/Test.php'; +require_once 'PHPUnit2/Framework/TestCase.php'; +require_once 'PHPUnit2/Framework/TestResult.php'; +require_once 'PHPUnit2/Runner/BaseTestRunner.php'; +require_once 'PHPUnit2/Util/Fileloader.php'; + +/** + * A TestSuite is a composite of Tests. It runs a collection of test cases. + * + * Here is an example using the dynamic test definition. + * + * + * addTest(new MathTest('testPass')); + * ?> + * + * + * Alternatively, a TestSuite can extract the tests to be run automatically. + * To do so you pass a ReflectionClass instance for your + * PHPUnit2_Framework_TestCase class to the PHPUnit2_Framework_TestSuite + * constructor. + * + * + * + * + * + * This constructor creates a suite with all the methods starting with + * "test" that take no arguments. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Framework_TestSuite implements PHPUnit2_Framework_Test { + /** + * The name of the test suite. + * + * @var string + * @access private + */ + private $name = ''; + + /** + * The tests in the test suite. + * + * @var array + * @access private + */ + private $tests = array(); + + /** + * Constructs a new TestSuite: + * + * - PHPUnit2_Framework_TestSuite() constructs an empty TestSuite. + * + * - PHPUnit2_Framework_TestSuite(ReflectionClass) constructs a + * TestSuite from the given class. + * + * - PHPUnit2_Framework_TestSuite(ReflectionClass, String) + * constructs a TestSuite from the given class with the given + * name. + * + * - PHPUnit2_Framework_TestSuite(String) either constructs a + * TestSuite from the given class (if the passed string is the + * name of an existing class) or constructs an empty TestSuite + * with the given name. + * + * @param mixed $theClass + * @param string $name + * @throws Exception + * @access public + */ + public function __construct($theClass = '', $name = '') { + $argumentsValid = FALSE; + + if (is_object($theClass) && + $theClass instanceof ReflectionClass) { + $argumentsValid = TRUE; + } + + else if (is_string($theClass) && $theClass !== '' && class_exists($theClass)) { + $argumentsValid = TRUE; + + if ($name == '') { + $name = $theClass; + } + + $theClass = new ReflectionClass($theClass); + } + + else if (is_string($theClass)) { + $this->setName($theClass); + return; + } + + if (!$argumentsValid) { + throw new Exception; + } + + if ($name != '') { + $this->setName($name); + } else { + $this->setName($theClass->getName()); + } + + $constructor = $theClass->getConstructor(); + + if ($constructor === NULL || + !$constructor->isPublic()) { + $this->addTest( + self::warning( + sprintf( + 'Class %s has no public constructor', + + $theClass->getName() + ) + ) + ); + + return; + } + + $methods = $theClass->getMethods(); + $names = array(); + + foreach ($methods as $method) { + $this->addTestMethod($method, $names, $theClass); + } + + if (empty($this->tests)) { + $this->addTest( + self::warning( + sprintf( + 'No tests found in %s', + + $theClass->getName() + ) + ) + ); + } + } + + /** + * Returns a string representation of the test suite. + * + * @return string + * @access public + */ + public function toString() { + return $this->getName(); + } + + /** + * Adds a test to the suite. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function addTest(PHPUnit2_Framework_Test $test) { + $this->tests[] = $test; + } + + /** + * Adds the tests from the given class to the suite. + * + * @param mixed $testClass + * @access public + */ + public function addTestSuite($testClass) { + if (is_string($testClass) && + class_exists($testClass)) { + $testClass = new ReflectionClass($testClass); + } + + if (is_object($testClass) && + $testClass instanceof ReflectionClass) { + $this->addTest(new PHPUnit2_Framework_TestSuite($testClass)); + } + } + + /** + * Wraps both addTest() and addTestSuite + * as well as the separate import statements for the user's convenience. + * + * If the named file cannot be read or there are no new tests that can be + * added, a PHPUnit2_Framework_Warning will be created instead, + * leaving the current test run untouched. + * + * @param string $filename + * @throws Exception + * @access public + * @since Method available since Release 2.3.0 + * @author Stefano F. Rausch + */ + public function addTestFile($filename) { + if (!is_string($filename) || !file_exists($filename)) { + throw new Exception; + } + + $declaredClasses = get_declared_classes(); + + PHPUnit2_Util_Fileloader::checkAndLoad($filename); + + $newClasses = array_values( + array_diff(get_declared_classes(), $declaredClasses) + ); + + $testsFound = 0; + + foreach ($newClasses as $class) { + if (preg_match('"Tests?$"', $class)) { + try { + $suiteMethod = new ReflectionMethod( + $class, PHPUnit2_Runner_BaseTestRunner::SUITE_METHODNAME + ); + + $this->addTest($suiteMethod->invoke(NULL)); + } catch (ReflectionException $e) { + $this->addTestSuite(new ReflectionClass($class)); + } + + $testsFound++; + } + } + + if ($testsFound == 0) { + $this->addTest( + new PHPUnit2_Framework_Warning('No tests found in file ' . $filename) + ); + } + } + + /** + * Wrapper for addTestFile() that adds multiple test files. + * + * @param Array $filenames + * @throws Exception + * @access public + * @since Method available since Release 2.3.0 + */ + public function addTestFiles($filenames) { + foreach ($filenames as $filename) { + $this->addTestFile($filename); + } + } + + /** + * Counts the number of test cases that will be run by this test. + * + * @return integer + * @access public + */ + public function countTestCases() { + $count = 0; + + foreach ($this->tests as $test) { + $count += $test->countTestCases(); + } + + return $count; + } + + /** + * @param ReflectionClass $theClass + * @param string $name + * @return PHPUnit2_Framework_Test + * @access public + * @static + */ + public static function createTest(ReflectionClass $theClass, $name) { + if (!$theClass->isInstantiable()) { + return self::warning( + sprintf( + 'Cannot instantiate test case %s.', + $theClass->getName() + ) + ); + } + + $constructor = $theClass->getConstructor(); + + if ($constructor !== NULL) { + $parameters = $constructor->getParameters(); + + if (sizeof($parameters) == 0) { + $test = $theClass->newInstance(); + + if ($test instanceof PHPUnit2_Framework_TestCase) { + $test->setName($name); + } + } + + else if (sizeof($parameters) == 1 && + $parameters[0]->getClass() === NULL) { + $test = $theClass->newInstance($name); + } + + else { + return self::warning( + sprintf( + 'Constructor of class %s is not TestCase($name) or TestCase().', + $theClass->getName() + ) + ); + } + } + + return $test; + } + + /** + * Creates a default TestResult object. + * + * @return PHPUnit2_Framework_TestResult + * @access protected + */ + protected function createResult() { + return new PHPUnit2_Framework_TestResult; + } + + /** + * Returns the name of the suite. + * + * @return string + * @access public + */ + public function getName() { + return $this->name; + } + + /** + * Runs the tests and collects their result in a TestResult. + * + * @param PHPUnit2_Framework_TestResult $result + * @return PHPUnit2_Framework_TestResult + * @throws Exception + * @access public + */ + public function run($result = NULL) { + if ($result === NULL) { + $result = $this->createResult(); + } + + // XXX: Workaround for missing ability to declare type-hinted parameters as optional. + else if (!($result instanceof PHPUnit2_Framework_TestResult)) { + throw new Exception( + 'Argument 1 must be an instance of PHPUnit2_Framework_TestResult.' + ); + } + + $result->startTestSuite($this); + + foreach ($this->tests as $test) { + if ($result->shouldStop()) { + break; + } + + $this->runTest($test, $result); + } + + $result->endTestSuite($this); + + return $result; + } + + /** + * Runs a test. + * + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_TestResult $testResult + * @access public + */ + public function runTest(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_TestResult $result) { + $test->run($result); + } + + /** + * Sets the name of the suite. + * + * @param string + * @access public + */ + public function setName($name) { + $this->name = $name; + } + + /** + * Returns the test at the given index. + * + * @param integer + * @return PHPUnit2_Framework_Test + * @access public + */ + public function testAt($index) { + if (isset($this->tests[$index])) { + return $this->tests[$index]; + } else { + return FALSE; + } + } + + /** + * Returns the number of tests in this suite. + * + * @return integer + * @access public + */ + public function testCount() { + return sizeof($this->tests); + } + + /** + * Returns the tests as an enumeration. + * + * @return array + * @access public + */ + public function tests() { + return $this->tests; + } + + /** + * @param ReflectionMethod $method + * @param array $names + * @param ReflectionClass $theClass + * @access private + */ + private function addTestMethod(ReflectionMethod $method, &$names, ReflectionClass $theClass) { + $name = $method->getName(); + + if (in_array($name, $names)) { + return; + } + + if ($this->isPublicTestMethod($method)) { + $names[] = $name; + + $this->addTest( + self::createTest( + $theClass, + $name + ) + ); + } + + else if ($this->isTestMethod($method)) { + $this->addTest( + self::warning( + sprintf( + 'Test method is not public: %s', + + $name + ) + ) + ); + } + } + + /** + * @param ReflectionMethod $method + * @return boolean + * @access private + */ + private function isPublicTestMethod(ReflectionMethod $method) { + return ($this->isTestMethod($method) && + $method->isPublic()); + } + + /** + * @param ReflectionMethod $method + * @return boolean + * @access private + */ + private function isTestMethod(ReflectionMethod $method) { + return (substr($method->name, 0, 4) == 'test'); + } + + /** + * @param string $message + * @return PHPUnit2_Framework_Warning + * @access private + */ + private static function warning($message) { + require_once 'PHPUnit2/Framework/Warning.php'; + return new PHPUnit2_Framework_Warning($message); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Framework/Warning.php b/buildscripts/PHPUnit2/Framework/Warning.php index 0ae885a4..6e5c072f 100644 --- a/buildscripts/PHPUnit2/Framework/Warning.php +++ b/buildscripts/PHPUnit2/Framework/Warning.php @@ -1,94 +1,94 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Warning.php,v 1.11.2.3 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/TestCase.php'; - -/** - * A warning. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Framework_Warning extends PHPUnit2_Framework_TestCase { - /** - * @var string - * @access private - */ - private $message = ''; - - /** - * @param string $message - * @access public - */ - public function __construct($message = '') { - $this->message = $message; - parent::__construct('Warning'); - } - - /** - * @access protected - */ - protected function runTest() { - $this->fail($this->message); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Warning.php,v 1.11.2.3 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/TestCase.php'; + +/** + * A warning. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Framework_Warning extends PHPUnit2_Framework_TestCase { + /** + * @var string + * @access private + */ + private $message = ''; + + /** + * @param string $message + * @access public + */ + public function __construct($message = '') { + $this->message = $message; + parent::__construct('Warning'); + } + + /** + * @access protected + */ + protected function runTest() { + $this->fail($this->message); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Runner/BaseTestRunner.php b/buildscripts/PHPUnit2/Runner/BaseTestRunner.php index b9517e5a..189309b8 100644 --- a/buildscripts/PHPUnit2/Runner/BaseTestRunner.php +++ b/buildscripts/PHPUnit2/Runner/BaseTestRunner.php @@ -1,283 +1,283 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: BaseTestRunner.php,v 1.18.2.3 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/AssertionFailedError.php'; -require_once 'PHPUnit2/Framework/TestListener.php'; -require_once 'PHPUnit2/Runner/StandardTestSuiteLoader.php'; - -/** - * Base class for all test runners. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - * @abstract - */ -abstract class PHPUnit2_Runner_BaseTestRunner implements PHPUnit2_Framework_TestListener { - const STATUS_ERROR = 1; - const STATUS_FAILURE = 2; - const STATUS_INCOMPLETE = 3; - const SUITE_METHODNAME = 'suite'; - - /** - * An error occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addError(PHPUnit2_Framework_Test $test, Exception $e) { - $this->testFailed(self::STATUS_ERROR, $test, $e); - } - - /** - * A failure occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_AssertionFailedError $e - * @access public - */ - public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { - $this->testFailed(self::STATUS_FAILURE, $test, $e); - } - - /** - * Incomplete test. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { - $this->testFailed(self::STATUS_INCOMPLETE, $test, $e); - } - - /** - * A testsuite started. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { - } - - /** - * A testsuite ended. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { - } - - /** - * A test started. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function startTest(PHPUnit2_Framework_Test $test) { - $this->testStarted($test->getName()); - } - - /** - * A test ended. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function endTest(PHPUnit2_Framework_Test $test) { - $this->testEnded($test->getName()); - } - - /** - * Returns the loader to be used. - * - * @return PHPUnit2_Runner_TestSuiteLoader - * @access public - */ - public function getLoader() { - return new PHPUnit2_Runner_StandardTestSuiteLoader; - } - - /** - * Returns the Test corresponding to the given suite. - * This is a template method, subclasses override - * the runFailed() and clearStatus() methods. - * - * @param string $suiteClassName - * @param string $suiteClassFile - * @return PHPUnit2_Framework_Test - * @access public - */ - public function getTest($suiteClassName, $suiteClassFile = '') { - if ($suiteClassFile == $suiteClassName . '.php') { - $suiteClassFile = ''; - } - - try { - $testClass = $this->loadSuiteClass($suiteClassName, $suiteClassFile); - } - - catch (Exception $e) { - $this->runFailed($e->getMessage()); - return NULL; - } - - try { - $suiteMethod = $testClass->getMethod(self::SUITE_METHODNAME); - - if (!$suiteMethod->isStatic()) { - $this->runFailed( - 'suite() method must be static.' - ); - - return NULL; - } - - try { - $test = $suiteMethod->invoke(NULL); - } - - catch (ReflectionException $e) { - $this->runFailed( - sprintf( - "Failed to invoke suite() method.\n%s", - - $e->getMessage() - ) - ); - - return NULL; - } - } - - catch (ReflectionException $e) { - $test = new PHPUnit2_Framework_TestSuite($testClass); - } - - $this->clearStatus(); - - return $test; - } - - /** - * Override to define how to handle a failed loading of - * a test suite. - * - * @param string $message - * @access protected - * @abstract - */ - protected abstract function runFailed($message); - - /** - * Returns the loaded ReflectionClass for a suite name. - * - * @param string $suiteClassName - * @param string $suiteClassFile - * @return ReflectionClass - * @access protected - */ - protected function loadSuiteClass($suiteClassName, $suiteClassFile = '') { - return $this->getLoader()->load($suiteClassName, $suiteClassFile); - } - - /** - * Clears the status message. - * - * @access protected - */ - protected function clearStatus() { - } - - /** - * A test started. - * - * @param string $testName - * @access public - * @abstract - */ - public abstract function testStarted($testName); - - /** - * A test ended. - * - * @param string $testName - * @access public - * @abstract - */ - public abstract function testEnded($testName); - - /** - * A test failed. - * - * @param integer $status - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_AssertionFailedError $e - * @access public - * @abstract - */ - public abstract function testFailed($status, PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: BaseTestRunner.php,v 1.18.2.3 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/AssertionFailedError.php'; +require_once 'PHPUnit2/Framework/TestListener.php'; +require_once 'PHPUnit2/Runner/StandardTestSuiteLoader.php'; + +/** + * Base class for all test runners. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + * @abstract + */ +abstract class PHPUnit2_Runner_BaseTestRunner implements PHPUnit2_Framework_TestListener { + const STATUS_ERROR = 1; + const STATUS_FAILURE = 2; + const STATUS_INCOMPLETE = 3; + const SUITE_METHODNAME = 'suite'; + + /** + * An error occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addError(PHPUnit2_Framework_Test $test, Exception $e) { + $this->testFailed(self::STATUS_ERROR, $test, $e); + } + + /** + * A failure occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_AssertionFailedError $e + * @access public + */ + public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { + $this->testFailed(self::STATUS_FAILURE, $test, $e); + } + + /** + * Incomplete test. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { + $this->testFailed(self::STATUS_INCOMPLETE, $test, $e); + } + + /** + * A testsuite started. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { + } + + /** + * A testsuite ended. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { + } + + /** + * A test started. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function startTest(PHPUnit2_Framework_Test $test) { + $this->testStarted($test->getName()); + } + + /** + * A test ended. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function endTest(PHPUnit2_Framework_Test $test) { + $this->testEnded($test->getName()); + } + + /** + * Returns the loader to be used. + * + * @return PHPUnit2_Runner_TestSuiteLoader + * @access public + */ + public function getLoader() { + return new PHPUnit2_Runner_StandardTestSuiteLoader; + } + + /** + * Returns the Test corresponding to the given suite. + * This is a template method, subclasses override + * the runFailed() and clearStatus() methods. + * + * @param string $suiteClassName + * @param string $suiteClassFile + * @return PHPUnit2_Framework_Test + * @access public + */ + public function getTest($suiteClassName, $suiteClassFile = '') { + if ($suiteClassFile == $suiteClassName . '.php') { + $suiteClassFile = ''; + } + + try { + $testClass = $this->loadSuiteClass($suiteClassName, $suiteClassFile); + } + + catch (Exception $e) { + $this->runFailed($e->getMessage()); + return NULL; + } + + try { + $suiteMethod = $testClass->getMethod(self::SUITE_METHODNAME); + + if (!$suiteMethod->isStatic()) { + $this->runFailed( + 'suite() method must be static.' + ); + + return NULL; + } + + try { + $test = $suiteMethod->invoke(NULL); + } + + catch (ReflectionException $e) { + $this->runFailed( + sprintf( + "Failed to invoke suite() method.\n%s", + + $e->getMessage() + ) + ); + + return NULL; + } + } + + catch (ReflectionException $e) { + $test = new PHPUnit2_Framework_TestSuite($testClass); + } + + $this->clearStatus(); + + return $test; + } + + /** + * Override to define how to handle a failed loading of + * a test suite. + * + * @param string $message + * @access protected + * @abstract + */ + protected abstract function runFailed($message); + + /** + * Returns the loaded ReflectionClass for a suite name. + * + * @param string $suiteClassName + * @param string $suiteClassFile + * @return ReflectionClass + * @access protected + */ + protected function loadSuiteClass($suiteClassName, $suiteClassFile = '') { + return $this->getLoader()->load($suiteClassName, $suiteClassFile); + } + + /** + * Clears the status message. + * + * @access protected + */ + protected function clearStatus() { + } + + /** + * A test started. + * + * @param string $testName + * @access public + * @abstract + */ + public abstract function testStarted($testName); + + /** + * A test ended. + * + * @param string $testName + * @access public + * @abstract + */ + public abstract function testEnded($testName); + + /** + * A test failed. + * + * @param integer $status + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_AssertionFailedError $e + * @access public + * @abstract + */ + public abstract function testFailed($status, PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e); +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Runner/IncludePathTestCollector.php b/buildscripts/PHPUnit2/Runner/IncludePathTestCollector.php index 116b20ed..b84f0e74 100644 --- a/buildscripts/PHPUnit2/Runner/IncludePathTestCollector.php +++ b/buildscripts/PHPUnit2/Runner/IncludePathTestCollector.php @@ -1,184 +1,184 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: IncludePathTestCollector.php,v 1.13.2.5 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.1.0 - */ - -if (!class_exists('AppendIterator')) { - class AppendIterator implements Iterator { - private $iterators; - - public function __construct() { - $this->iterators = new ArrayIterator(); - } - - public function __call($func, $params) { - return call_user_func_array(array($this->getInnerIterator(), $func), $params); - } - - public function append(Iterator $it) { - $this->iterators->append($it); - } - - public function getInnerIterator() { - return $this->iterators->current(); - } - - public function rewind() { - $this->iterators->rewind(); - - if ($this->iterators->valid()) { - $this->getInnerIterator()->rewind(); - } - } - - public function valid() { - return $this->iterators->valid() && $this->getInnerIterator()->valid(); - } - - public function current() { - return $this->iterators->valid() ? $this->getInnerIterator()->current() : NULL; - } - - public function key() { - return $this->iterators->valid() ? $this->getInnerIterator()->key() : NULL; - } - - public function next() { - if (!$this->iterators->valid()) return; - $this->getInnerIterator()->next(); - - if ($this->getInnerIterator()->valid()) return; - $this->iterators->next(); - - while ($this->iterators->valid()) { - $this->getInnerIterator()->rewind(); - - if ($this->getInnerIterator()->valid()) return; - $this->iterators->next(); - } - } - } -} - -require_once 'PHPUnit2/Runner/TestCollector.php'; - -require_once 'PEAR/Config.php'; - -/** - * An implementation of a TestCollector that consults the - * include path set in the php.ini. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ - -class PHPUnit2_Runner_IncludePathTestCollector implements PHPUnit2_Runner_TestCollector { - /** - * @return array - * @access public - */ - public function collectTests() { - $config = new PEAR_Config; - $iterator = new AppendIterator; - $result = array(); - - if (substr(PHP_OS, 0, 3) == 'WIN') { - $delimiter = ';'; - } else { - $delimiter = ':'; - } - - $paths = explode($delimiter, ini_get('include_path')); - $paths[] = $config->get('test_dir'); - - foreach ($paths as $path) { - $iterator->append( - new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($path) - ) - ); - } - - foreach ($iterator as $path => $file) { - if ($this->isTestClass($file)) { - if (substr(PHP_OS, 0, 3) == 'WIN') { - $path = str_replace('/', '\\', $path); - } - - $result[] = $path; - } - } - - return $result; - } - - /** - * Considers a file to contain a test class when it contains the - * pattern "Test" in its name and its name ends with ".php". - * - * @param string $classFileName - * @return boolean - * @access protected - */ - protected function isTestClass($classFileName) { - return (strpos($classFileName, 'Test') !== FALSE && substr($classFileName, -4) == '.php') ? TRUE : FALSE; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: IncludePathTestCollector.php,v 1.13.2.5 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.1.0 + */ + +if (!class_exists('AppendIterator')) { + class AppendIterator implements Iterator { + private $iterators; + + public function __construct() { + $this->iterators = new ArrayIterator(); + } + + public function __call($func, $params) { + return call_user_func_array(array($this->getInnerIterator(), $func), $params); + } + + public function append(Iterator $it) { + $this->iterators->append($it); + } + + public function getInnerIterator() { + return $this->iterators->current(); + } + + public function rewind() { + $this->iterators->rewind(); + + if ($this->iterators->valid()) { + $this->getInnerIterator()->rewind(); + } + } + + public function valid() { + return $this->iterators->valid() && $this->getInnerIterator()->valid(); + } + + public function current() { + return $this->iterators->valid() ? $this->getInnerIterator()->current() : NULL; + } + + public function key() { + return $this->iterators->valid() ? $this->getInnerIterator()->key() : NULL; + } + + public function next() { + if (!$this->iterators->valid()) return; + $this->getInnerIterator()->next(); + + if ($this->getInnerIterator()->valid()) return; + $this->iterators->next(); + + while ($this->iterators->valid()) { + $this->getInnerIterator()->rewind(); + + if ($this->getInnerIterator()->valid()) return; + $this->iterators->next(); + } + } + } +} + +require_once 'PHPUnit2/Runner/TestCollector.php'; + +require_once 'PEAR/Config.php'; + +/** + * An implementation of a TestCollector that consults the + * include path set in the php.ini. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ + +class PHPUnit2_Runner_IncludePathTestCollector implements PHPUnit2_Runner_TestCollector { + /** + * @return array + * @access public + */ + public function collectTests() { + $config = new PEAR_Config; + $iterator = new AppendIterator; + $result = array(); + + if (substr(PHP_OS, 0, 3) == 'WIN') { + $delimiter = ';'; + } else { + $delimiter = ':'; + } + + $paths = explode($delimiter, ini_get('include_path')); + $paths[] = $config->get('test_dir'); + + foreach ($paths as $path) { + $iterator->append( + new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path) + ) + ); + } + + foreach ($iterator as $path => $file) { + if ($this->isTestClass($file)) { + if (substr(PHP_OS, 0, 3) == 'WIN') { + $path = str_replace('/', '\\', $path); + } + + $result[] = $path; + } + } + + return $result; + } + + /** + * Considers a file to contain a test class when it contains the + * pattern "Test" in its name and its name ends with ".php". + * + * @param string $classFileName + * @return boolean + * @access protected + */ + protected function isTestClass($classFileName) { + return (strpos($classFileName, 'Test') !== FALSE && substr($classFileName, -4) == '.php') ? TRUE : FALSE; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Runner/StandardTestSuiteLoader.php b/buildscripts/PHPUnit2/Runner/StandardTestSuiteLoader.php index b0c359a0..e7fccfda 100644 --- a/buildscripts/PHPUnit2/Runner/StandardTestSuiteLoader.php +++ b/buildscripts/PHPUnit2/Runner/StandardTestSuiteLoader.php @@ -1,129 +1,129 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: StandardTestSuiteLoader.php,v 1.19.2.8 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Runner/TestSuiteLoader.php'; -require_once 'PHPUnit2/Util/Fileloader.php'; - -require_once 'PEAR/Config.php'; - -/** - * The standard test suite loader. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Runner_StandardTestSuiteLoader implements PHPUnit2_Runner_TestSuiteLoader { - /** - * @param string $suiteClassName - * @param string $suiteClassFile - * @return ReflectionClass - * @throws Exception - * @access public - */ - public function load($suiteClassName, $suiteClassFile = '') { - $suiteClassName = str_replace('.php', '', $suiteClassName); - $suiteClassFile = !empty($suiteClassFile) ? $suiteClassFile : str_replace('_', '/', $suiteClassName) . '.php'; - - if (!class_exists($suiteClassName)) { - if(!file_exists($suiteClassFile)) { - $config = new PEAR_Config; - - $includePaths = explode(PATH_SEPARATOR, get_include_path()); - $includePaths[] = $config->get('test_dir'); - - foreach ($includePaths as $includePath) { - $file = $includePath . DIRECTORY_SEPARATOR . $suiteClassFile; - - if (file_exists($file)) { - $suiteClassFile = $file; - break; - } - } - } - - PHPUnit2_Util_Fileloader::checkAndLoad($suiteClassFile); - } - - if (class_exists($suiteClassName)) { - return new ReflectionClass($suiteClassName); - } else { - throw new Exception( - sprintf( - 'Class %s could not be found in %s.', - - $suiteClassName, - $suiteClassFile - ) - ); - } - } - - /** - * @param ReflectionClass $aClass - * @return ReflectionClass - * @access public - */ - public function reload(ReflectionClass $aClass) { - return $aClass; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: StandardTestSuiteLoader.php,v 1.19.2.8 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Runner/TestSuiteLoader.php'; +require_once 'PHPUnit2/Util/Fileloader.php'; + +require_once 'PEAR/Config.php'; + +/** + * The standard test suite loader. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Runner_StandardTestSuiteLoader implements PHPUnit2_Runner_TestSuiteLoader { + /** + * @param string $suiteClassName + * @param string $suiteClassFile + * @return ReflectionClass + * @throws Exception + * @access public + */ + public function load($suiteClassName, $suiteClassFile = '') { + $suiteClassName = str_replace('.php', '', $suiteClassName); + $suiteClassFile = !empty($suiteClassFile) ? $suiteClassFile : str_replace('_', '/', $suiteClassName) . '.php'; + + if (!class_exists($suiteClassName)) { + if(!file_exists($suiteClassFile)) { + $config = new PEAR_Config; + + $includePaths = explode(PATH_SEPARATOR, get_include_path()); + $includePaths[] = $config->get('test_dir'); + + foreach ($includePaths as $includePath) { + $file = $includePath . DIRECTORY_SEPARATOR . $suiteClassFile; + + if (file_exists($file)) { + $suiteClassFile = $file; + break; + } + } + } + + PHPUnit2_Util_Fileloader::checkAndLoad($suiteClassFile); + } + + if (class_exists($suiteClassName)) { + return new ReflectionClass($suiteClassName); + } else { + throw new Exception( + sprintf( + 'Class %s could not be found in %s.', + + $suiteClassName, + $suiteClassFile + ) + ); + } + } + + /** + * @param ReflectionClass $aClass + * @return ReflectionClass + * @access public + */ + public function reload(ReflectionClass $aClass) { + return $aClass; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Runner/TestCollector.php b/buildscripts/PHPUnit2/Runner/TestCollector.php index 38a9ce81..9c77e6da 100644 --- a/buildscripts/PHPUnit2/Runner/TestCollector.php +++ b/buildscripts/PHPUnit2/Runner/TestCollector.php @@ -1,77 +1,77 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestCollector.php,v 1.7.2.2 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -/** - * Collects Test class names to be presented - * by the TestSelector. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Interface available since Release 2.0.0 - */ -interface PHPUnit2_Runner_TestCollector { - /** - * @return array - * @access public - */ - public function collectTests(); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestCollector.php,v 1.7.2.2 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +/** + * Collects Test class names to be presented + * by the TestSelector. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Interface available since Release 2.0.0 + */ +interface PHPUnit2_Runner_TestCollector { + /** + * @return array + * @access public + */ + public function collectTests(); +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Runner/TestSuiteLoader.php b/buildscripts/PHPUnit2/Runner/TestSuiteLoader.php index 711a03d2..99b91a06 100644 --- a/buildscripts/PHPUnit2/Runner/TestSuiteLoader.php +++ b/buildscripts/PHPUnit2/Runner/TestSuiteLoader.php @@ -1,85 +1,85 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestSuiteLoader.php,v 1.11.2.2 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -/** - * An interface to define how a test suite should be loaded. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Interface available since Release 2.0.0 - */ -interface PHPUnit2_Runner_TestSuiteLoader { - /** - * @param string $suiteClassName - * @param string $suiteClassFile - * @return ReflectionClass - * @access public - */ - public function load($suiteClassName, $suiteClassFile = ''); - - /** - * @param ReflectionClass $aClass - * @return ReflectionClass - * @access public - */ - public function reload(ReflectionClass $aClass); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestSuiteLoader.php,v 1.11.2.2 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +/** + * An interface to define how a test suite should be loaded. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Interface available since Release 2.0.0 + */ +interface PHPUnit2_Runner_TestSuiteLoader { + /** + * @param string $suiteClassName + * @param string $suiteClassFile + * @return ReflectionClass + * @access public + */ + public function load($suiteClassName, $suiteClassFile = ''); + + /** + * @param ReflectionClass $aClass + * @return ReflectionClass + * @access public + */ + public function reload(ReflectionClass $aClass); +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Runner/Version.php b/buildscripts/PHPUnit2/Runner/Version.php index 5a0f7785..49222c98 100644 --- a/buildscripts/PHPUnit2/Runner/Version.php +++ b/buildscripts/PHPUnit2/Runner/Version.php @@ -1,90 +1,90 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Version.php,v 1.7.2.2 2005/12/17 16:04:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -/** - * This class defines the current version of PHPUnit. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Runner_Version { - /** - * Returns the current version of PHPUnit. - * - * @return string - * @access public - * @static - */ - public static function id() { - return '@package_version@'; - } - - /** - * @return string - * @access public - * @static - */ - public static function getVersionString() { - return 'PHPUnit @package_version@ by Sebastian Bergmann.'; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Version.php,v 1.7.2.2 2005/12/17 16:04:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +/** + * This class defines the current version of PHPUnit. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Runner_Version { + /** + * Returns the current version of PHPUnit. + * + * @return string + * @access public + * @static + */ + public static function id() { + return '@package_version@'; + } + + /** + * @return string + * @access public + * @static + */ + public static function getVersionString() { + return 'PHPUnit @package_version@ by Sebastian Bergmann.'; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/TextUI/ResultPrinter.php b/buildscripts/PHPUnit2/TextUI/ResultPrinter.php index 32d3e667..d441e92c 100644 --- a/buildscripts/PHPUnit2/TextUI/ResultPrinter.php +++ b/buildscripts/PHPUnit2/TextUI/ResultPrinter.php @@ -1,356 +1,356 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: ResultPrinter.php,v 1.20.2.5 2005/12/17 16:04:57 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -require_once 'PHPUnit2/Framework/TestListener.php'; -require_once 'PHPUnit2/Framework/TestFailure.php'; -require_once 'PHPUnit2/Util/Filter.php'; -require_once 'PHPUnit2/Util/Printer.php'; - -/** - * Prints the result of a TextUI TestRunner run. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_TextUI_ResultPrinter extends PHPUnit2_Util_Printer implements PHPUnit2_Framework_TestListener { - /** - * @var integer - * @access private - */ - private $column = 0; - - /** - * @var boolean - * @access private - */ - private $lastTestFailed = FALSE; - - /** - * @param PHPUnit2_Framework_TestResult $result - * @param float $runTime - * @access public - */ - public function printResult(PHPUnit2_Framework_TestResult $result, $timeElapsed) { - $this->printHeader($timeElapsed); - $this->printErrors($result); - $this->printFailures($result); - $this->printIncompletes($result); - $this->printFooter($result); - } - - /** - * @param array $defects - * @param integer $count - * @param string $type - * @access protected - */ - protected function printDefects($defects, $count, $type) { - if ($count == 0) { - return; - } - - $this->write( - sprintf( - "There %s %d %s%s:\n", - - ($count == 1) ? 'was' : 'were', - $count, - $type, - ($count == 1) ? '' : 's' - ) - ); - - $i = 1; - - foreach ($defects as $defect) { - $this->printDefect($defect, $i++); - } - } - - /** - * @param PHPUnit2_Framework_TestFailure $defect - * @param integer $count - * @access protected - */ - protected function printDefect(PHPUnit2_Framework_TestFailure $defect, $count) { - $this->printDefectHeader($defect, $count); - $this->printDefectTrace($defect); - } - - /** - * @param PHPUnit2_Framework_TestFailure $defect - * @param integer $count - * @access protected - */ - protected function printDefectHeader(PHPUnit2_Framework_TestFailure $defect, $count) { - $this->write( - sprintf( - "%d) %s\n", - - $count, - $defect->failedTest()->toString() - ) - ); - } - - /** - * @param PHPUnit2_Framework_TestFailure $defect - * @access protected - */ - protected function printDefectTrace(PHPUnit2_Framework_TestFailure $defect) { - $e = $defect->thrownException(); - $message = method_exists($e, 'toString') ? $e->toString() : $e->getMessage(); - - $this->write($message . "\n"); - - $this->write( - PHPUnit2_Util_Filter::getFilteredStacktrace( - $defect->thrownException() - ) - ); - } - - /** - * @param PHPUnit2_Framework_TestResult $result - * @access protected - */ - protected function printErrors(PHPUnit2_Framework_TestResult $result) { - $this->printDefects($result->errors(), $result->errorCount(), 'error'); - } - - /** - * @param PHPUnit2_Framework_TestResult $result - * @access protected - */ - protected function printFailures(PHPUnit2_Framework_TestResult $result) { - $this->printDefects($result->failures(), $result->failureCount(), 'failure'); - } - - /** - * @param PHPUnit2_Framework_TestResult $result - * @access protected - */ - protected function printIncompletes(PHPUnit2_Framework_TestResult $result) { - $this->printDefects($result->notImplemented(), $result->notImplementedCount(), 'incomplete test case'); - } - - /** - * @param float $timeElapsed - * @access protected - */ - protected function printHeader($timeElapsed) { - $this->write( - sprintf( - "\n\nTime: %s\n", - - $timeElapsed - ) - ); - } - - /** - * @param PHPUnit2_Framework_TestResult $result - * @access protected - */ - protected function printFooter(PHPUnit2_Framework_TestResult $result) { - if ($result->allCompletlyImplemented() && - $result->wasSuccessful()) { - $this->write( - sprintf( - "\nOK (%d test%s)\n", - - $result->runCount(), - ($result->runCount() == 1) ? '' : 's' - ) - ); - } - - else if (!$result->allCompletlyImplemented() && - $result->wasSuccessful()) { - $this->write( - sprintf( - "\nOK, but incomplete test cases!!!\nTests run: %d, Incomplete Tests: %d.\n", - - $result->runCount(), - $result->notImplementedCount() - ) - ); - } - - else { - $this->write( - sprintf( - "\nFAILURES!!!\nTests run: %d, Failures: %d, Errors: %d, Incomplete Tests: %d.\n", - - $result->runCount(), - $result->failureCount(), - $result->errorCount(), - $result->notImplementedCount() - ) - ); - } - } - - /** - * @access public - */ - public function printWaitPrompt() { - $this->write("\n to continue\n"); - } - - /** - * An error occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addError(PHPUnit2_Framework_Test $test, Exception $e) { - $this->write('E'); - $this->nextColumn(); - - $this->lastTestFailed = TRUE; - } - - /** - * A failure occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_AssertionFailedError $e - * @access public - */ - public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { - $this->write('F'); - $this->nextColumn(); - - $this->lastTestFailed = TRUE; - } - - /** - * Incomplete test. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { - $this->write('I'); - $this->nextColumn(); - - $this->lastTestFailed = TRUE; - } - - /** - * A testsuite started. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { - } - - /** - * A testsuite ended. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { - } - - /** - * A test started. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function startTest(PHPUnit2_Framework_Test $test) { - } - - /** - * A test ended. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function endTest(PHPUnit2_Framework_Test $test) { - if (!$this->lastTestFailed) { - $this->write('.'); - $this->nextColumn(); - } - - $this->lastTestFailed = FALSE; - } - - /** - * @access protected - */ - protected function nextColumn() { - if ($this->column++ >= 40) { - $this->column = 0; - $this->write("\n"); - } - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: ResultPrinter.php,v 1.20.2.5 2005/12/17 16:04:57 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +require_once 'PHPUnit2/Framework/TestListener.php'; +require_once 'PHPUnit2/Framework/TestFailure.php'; +require_once 'PHPUnit2/Util/Filter.php'; +require_once 'PHPUnit2/Util/Printer.php'; + +/** + * Prints the result of a TextUI TestRunner run. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_TextUI_ResultPrinter extends PHPUnit2_Util_Printer implements PHPUnit2_Framework_TestListener { + /** + * @var integer + * @access private + */ + private $column = 0; + + /** + * @var boolean + * @access private + */ + private $lastTestFailed = FALSE; + + /** + * @param PHPUnit2_Framework_TestResult $result + * @param float $runTime + * @access public + */ + public function printResult(PHPUnit2_Framework_TestResult $result, $timeElapsed) { + $this->printHeader($timeElapsed); + $this->printErrors($result); + $this->printFailures($result); + $this->printIncompletes($result); + $this->printFooter($result); + } + + /** + * @param array $defects + * @param integer $count + * @param string $type + * @access protected + */ + protected function printDefects($defects, $count, $type) { + if ($count == 0) { + return; + } + + $this->write( + sprintf( + "There %s %d %s%s:\n", + + ($count == 1) ? 'was' : 'were', + $count, + $type, + ($count == 1) ? '' : 's' + ) + ); + + $i = 1; + + foreach ($defects as $defect) { + $this->printDefect($defect, $i++); + } + } + + /** + * @param PHPUnit2_Framework_TestFailure $defect + * @param integer $count + * @access protected + */ + protected function printDefect(PHPUnit2_Framework_TestFailure $defect, $count) { + $this->printDefectHeader($defect, $count); + $this->printDefectTrace($defect); + } + + /** + * @param PHPUnit2_Framework_TestFailure $defect + * @param integer $count + * @access protected + */ + protected function printDefectHeader(PHPUnit2_Framework_TestFailure $defect, $count) { + $this->write( + sprintf( + "%d) %s\n", + + $count, + $defect->failedTest()->toString() + ) + ); + } + + /** + * @param PHPUnit2_Framework_TestFailure $defect + * @access protected + */ + protected function printDefectTrace(PHPUnit2_Framework_TestFailure $defect) { + $e = $defect->thrownException(); + $message = method_exists($e, 'toString') ? $e->toString() : $e->getMessage(); + + $this->write($message . "\n"); + + $this->write( + PHPUnit2_Util_Filter::getFilteredStacktrace( + $defect->thrownException() + ) + ); + } + + /** + * @param PHPUnit2_Framework_TestResult $result + * @access protected + */ + protected function printErrors(PHPUnit2_Framework_TestResult $result) { + $this->printDefects($result->errors(), $result->errorCount(), 'error'); + } + + /** + * @param PHPUnit2_Framework_TestResult $result + * @access protected + */ + protected function printFailures(PHPUnit2_Framework_TestResult $result) { + $this->printDefects($result->failures(), $result->failureCount(), 'failure'); + } + + /** + * @param PHPUnit2_Framework_TestResult $result + * @access protected + */ + protected function printIncompletes(PHPUnit2_Framework_TestResult $result) { + $this->printDefects($result->notImplemented(), $result->notImplementedCount(), 'incomplete test case'); + } + + /** + * @param float $timeElapsed + * @access protected + */ + protected function printHeader($timeElapsed) { + $this->write( + sprintf( + "\n\nTime: %s\n", + + $timeElapsed + ) + ); + } + + /** + * @param PHPUnit2_Framework_TestResult $result + * @access protected + */ + protected function printFooter(PHPUnit2_Framework_TestResult $result) { + if ($result->allCompletlyImplemented() && + $result->wasSuccessful()) { + $this->write( + sprintf( + "\nOK (%d test%s)\n", + + $result->runCount(), + ($result->runCount() == 1) ? '' : 's' + ) + ); + } + + else if (!$result->allCompletlyImplemented() && + $result->wasSuccessful()) { + $this->write( + sprintf( + "\nOK, but incomplete test cases!!!\nTests run: %d, Incomplete Tests: %d.\n", + + $result->runCount(), + $result->notImplementedCount() + ) + ); + } + + else { + $this->write( + sprintf( + "\nFAILURES!!!\nTests run: %d, Failures: %d, Errors: %d, Incomplete Tests: %d.\n", + + $result->runCount(), + $result->failureCount(), + $result->errorCount(), + $result->notImplementedCount() + ) + ); + } + } + + /** + * @access public + */ + public function printWaitPrompt() { + $this->write("\n to continue\n"); + } + + /** + * An error occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addError(PHPUnit2_Framework_Test $test, Exception $e) { + $this->write('E'); + $this->nextColumn(); + + $this->lastTestFailed = TRUE; + } + + /** + * A failure occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_AssertionFailedError $e + * @access public + */ + public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { + $this->write('F'); + $this->nextColumn(); + + $this->lastTestFailed = TRUE; + } + + /** + * Incomplete test. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { + $this->write('I'); + $this->nextColumn(); + + $this->lastTestFailed = TRUE; + } + + /** + * A testsuite started. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { + } + + /** + * A testsuite ended. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { + } + + /** + * A test started. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function startTest(PHPUnit2_Framework_Test $test) { + } + + /** + * A test ended. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function endTest(PHPUnit2_Framework_Test $test) { + if (!$this->lastTestFailed) { + $this->write('.'); + $this->nextColumn(); + } + + $this->lastTestFailed = FALSE; + } + + /** + * @access protected + */ + protected function nextColumn() { + if ($this->column++ >= 40) { + $this->column = 0; + $this->write("\n"); + } + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/TextUI/TestRunner.php b/buildscripts/PHPUnit2/TextUI/TestRunner.php index 63639a24..b21cfca4 100644 --- a/buildscripts/PHPUnit2/TextUI/TestRunner.php +++ b/buildscripts/PHPUnit2/TextUI/TestRunner.php @@ -1,622 +1,622 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestRunner.php,v 1.64.2.5 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -if (!defined('PHPUnit2_MAIN_METHOD')) { - define('PHPUnit2_MAIN_METHOD', 'PHPUnit2_TextUI_TestRunner::main'); -} - -require_once 'PHPUnit2/Framework/TestSuite.php'; -require_once 'PHPUnit2/Runner/Version.php'; -require_once 'PHPUnit2/Runner/BaseTestRunner.php'; -require_once 'PHPUnit2/TextUI/ResultPrinter.php'; -require_once 'PHPUnit2/Util/Fileloader.php'; - -require_once 'Console/Getopt.php'; -require_once 'Benchmark/Timer.php'; - -/** - * A TestRunner for the Command Line Interface (CLI) - * PHP SAPI Module. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_TextUI_TestRunner extends PHPUnit2_Runner_BaseTestRunner { - const SUCCESS_EXIT = 0; - const FAILURE_EXIT = 1; - const EXCEPTION_EXIT = 2; - - /** - * @var PHPUnit2_Runner_TestSuiteLoader - * @access private - */ - private $loader = NULL; - - /** - * @var PHPUnit2_TextUI_ResultPrinter - * @access private - */ - private $printer = NULL; - - /** - * @var boolean - * @access private - * @static - */ - private static $versionStringPrinted = FALSE; - - /** - * @access public - * @static - */ - public static function main() { - $aTestRunner = new PHPUnit2_TextUI_TestRunner; - - try { - $result = $aTestRunner->start($_SERVER['argv']); - - if (!$result->wasSuccessful()) { - exit(self::FAILURE_EXIT); - } - - exit(self::SUCCESS_EXIT); - } - - catch (Exception $e) { - self::printVersionString(); - print $e->getMessage(); - exit(self::EXCEPTION_EXIT); - } - } - - /** - * @param array $arguments - * @throws Exception - * @access protected - */ - protected function start($arguments) { - $coverageDataFile = FALSE; - $coverageHTMLFile = FALSE; - $coverageTextFile = FALSE; - $testdoxHTMLFile = FALSE; - $testdoxTextFile = FALSE; - $xmlLogfile = FALSE; - $wait = FALSE; - - $possibleOptions = array( - 'help', - 'loader=', - 'log-xml=', - 'skeleton', - 'testdox-html=', - 'testdox-text=', - 'version', - 'wait' - ); - - if (extension_loaded('xdebug')) { - $possibleOptions[] = 'coverage-data='; - $possibleOptions[] = 'coverage-html='; - $possibleOptions[] = 'coverage-text='; - } - - $options = Console_Getopt::getopt( - $arguments, - '', - $possibleOptions - ); - - if (PEAR::isError($options)) { - $this->showError($options->getMessage()); - } - - $test = isset($options[1][0]) ? $options[1][0] : FALSE; - $testFile = isset($options[1][1]) ? $options[1][1] : $test . '.php'; - - foreach ($options[0] as $option) { - switch ($option[0]) { - case '--coverage-data': { - $coverageDataFile = $option[1]; - } - break; - - case '--coverage-html': { - $coverageHTMLFile = $option[1]; - } - break; - - case '--coverage-text': { - $coverageTextFile = $option[1]; - } - break; - - case '--help': { - $this->showHelp(); - exit(self::SUCCESS_EXIT); - } - break; - - case '--testdox-html': { - $testdoxHTMLFile = $option[1]; - } - break; - - case '--testdox-text': { - $testdoxTextFile = $option[1]; - } - break; - - case '--loader': { - if (!class_exists($option[1])) { - PHPUnit2_Util_Fileloader::checkAndLoad( - str_replace('_', '/', $option[1]) . '.php' - ); - } - - if (class_exists($option[1])) { - $class = new ReflectionClass($option[1]); - - if ($class->implementsInterface('PHPUnit2_Runner_TestSuiteLoader') && - $class->isInstantiable()) { - $this->loader = $class->newInstance(); - } - } - - if ($this->loader === NULL) { - $this->showError( - sprintf( - 'Could not use "%s" as loader.', - - $option[1] - ) - ); - } - } - break; - - case '--log-xml': { - $xmlLogfile = $option[1]; - } - break; - - case '--skeleton': { - if ($test !== FALSE) { - self::printVersionString(); - - try { - require_once 'PHPUnit2/Util/Skeleton.php'; - - $skeleton = new PHPUnit2_Util_Skeleton($test, $testFile); - $skeleton->write(); - } - - catch (Exception $e) { - print $e->getMessage() . "\n"; - - printf( - "Could not write test class skeleton for %s to %s.\n", - $test, - $test . 'Test.php' - ); - - exit(self::FAILURE_EXIT); - } - - printf( - "Wrote test class skeleton for %s to %s.\n", - $test, - $test . 'Test.php' - ); - - exit(self::SUCCESS_EXIT); - } - } - break; - - case '--version': { - self::printVersionString(); - exit(self::SUCCESS_EXIT); - } - break; - - case '--wait': { - $wait = TRUE; - } - break; - } - } - - if ($test === FALSE) { - $this->showHelp(); - - exit(self::SUCCESS_EXIT); - } - - try { - return $this->doRun( - $this->getTest($test, $testFile), - $coverageDataFile, - $coverageHTMLFile, - $coverageTextFile, - $testdoxHTMLFile, - $testdoxTextFile, - $xmlLogfile, - $wait - ); - } - - catch (Exception $e) { - throw new Exception( - 'Could not create and run test suite: ' . $e->getMessage() - ); - } - } - - /** - * @param mixed $test - * @param mixed $coverageDataFile - * @param mixed $testdoxHTMLFile - * @param mixed $testdoxTextFile - * @param mixed $xmlLogfile - * @param boolean $wait - * @access public - * @static - */ - public static function run($test, $coverageDataFile = FALSE, $coverageHTMLFile = FALSE, $coverageTextFile = FALSE, $testdoxHTMLFile = FALSE, $testdoxTextFile = FALSE, $xmlLogfile = FALSE, $wait = FALSE) { - if ($test instanceof ReflectionClass) { - $test = new PHPUnit2_Framework_TestSuite($test); - } - - if ($test instanceof PHPUnit2_Framework_Test) { - $aTestRunner = new PHPUnit2_TextUI_TestRunner; - - return $aTestRunner->doRun( - $test, - $coverageDataFile, - $coverageHTMLFile, - $coverageTextFile, - $testdoxHTMLFile, - $testdoxTextFile, - $xmlLogfile, - $wait - ); - } - } - - /** - * Runs a single test and waits until the user types RETURN. - * - * @param PHPUnit2_Framework_Test $suite - * @access public - * @static - */ - public static function runAndWait(PHPUnit2_Framework_Test $suite) { - $aTestRunner = new PHPUnit2_TextUI_TestRunner; - - $aTestRunner->doRun( - $suite, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - TRUE - ); - } - - /** - * @return PHPUnit2_Framework_TestResult - * @access protected - */ - protected function createTestResult() { - return new PHPUnit2_Framework_TestResult; - } - - /** - * @param PHPUnit2_Framework_Test $suite - * @param mixed $coverageDataFile - * @param mixed $coverageHTMLFile - * @param mixed $coverageTextFile - * @param mixed $testdoxHTMLFile - * @param mixed $testdoxTextFile - * @param mixed $xmlLogfile - * @param boolean $wait - * @return PHPUnit2_Framework_TestResult - * @access public - */ - public function doRun(PHPUnit2_Framework_Test $suite, $coverageDataFile = FALSE, $coverageHTMLFile = FALSE, $coverageTextFile = FALSE, $testdoxHTMLFile = FALSE, $testdoxTextFile = FALSE, $xmlLogfile = FALSE, $wait = FALSE) { - $result = $this->createTestResult(); - $timer = new Benchmark_Timer; - - if ($this->printer === NULL) { - $this->printer = new PHPUnit2_TextUI_ResultPrinter; - } - - $this->printer->write( - PHPUnit2_Runner_Version::getVersionString() . "\n\n" - ); - - $result->addListener($this->printer); - - if ($testdoxHTMLFile !== FALSE || $testdoxTextFile !== FALSE) { - require_once 'PHPUnit2/Util/TestDox/ResultPrinter.php'; - - if ($testdoxHTMLFile !== FALSE) { - $result->addListener( - PHPUnit2_Util_TestDox_ResultPrinter::factory( - 'HTML', - $testdoxHTMLFile - ) - ); - } - - if ($testdoxTextFile !== FALSE) { - $result->addListener( - PHPUnit2_Util_TestDox_ResultPrinter::factory( - 'Text', - $testdoxTextFile - ) - ); - } - } - - if ($xmlLogfile !== FALSE) { - require_once 'PHPUnit2/Util/Log/XML.php'; - - $result->addListener( - new PHPUnit2_Util_Log_XML($xmlLogfile) - ); - } - - if ($coverageDataFile !== FALSE || - $coverageHTMLFile !== FALSE || - $coverageTextFile !== FALSE) { - $result->collectCodeCoverageInformation(TRUE); - } - - $timer->start(); - $suite->run($result); - $timer->stop(); - $timeElapsed = $timer->timeElapsed(); - - $this->pause($wait); - - $this->printer->printResult($result, $timeElapsed); - - $this->handleCodeCoverageInformation( - $result, - $coverageDataFile, - $coverageHTMLFile, - $coverageTextFile - ); - - return $result; - } - - /** - * Returns the loader to be used. - * - * @return PHPUnit2_Runner_TestSuiteLoader - * @access public - * @since Method available since Release 2.2.0 - */ - public function getLoader() { - if ($this->loader === NULL) { - $this->loader = new PHPUnit2_Runner_StandardTestSuiteLoader; - } - - return $this->loader; - } - - /** - * @param PHPUnit2_Framework_TestResult $result - * @param mixed $coverageDataFile - * @param mixed $coverageHTMLFile - * @param mixed $coverageTextFile - * @access protected - * @since Method available since Release 2.1.0 - */ - protected function handleCodeCoverageInformation(PHPUnit2_Framework_TestResult $result, $coverageDataFile, $coverageHTMLFile, $coverageTextFile) { - if ($coverageDataFile !== FALSE && - $fp = fopen($coverageDataFile, 'w')) { - fputs($fp, serialize($result->getCodeCoverageInformation())); - fclose($fp); - } - - if ($coverageHTMLFile !== FALSE || $coverageTextFile !== FALSE) { - require_once 'PHPUnit2/Util/CodeCoverage/Renderer.php'; - - if ($coverageHTMLFile !== FALSE) { - $renderer = PHPUnit2_Util_CodeCoverage_Renderer::factory( - 'HTML', - $result->getCodeCoverageInformation() - ); - - $renderer->renderToFile($coverageHTMLFile); - } - - if ($coverageTextFile !== FALSE) { - $renderer = PHPUnit2_Util_CodeCoverage_Renderer::factory( - 'Text', - $result->getCodeCoverageInformation() - ); - - $renderer->renderToFile($coverageTextFile); - } - } - } - - /** - * @access public - */ - public function showError($message) { - self::printVersionString(); - print $message . "\n"; - - exit(self::FAILURE_EXIT); - } - - /** - * @access public - */ - public function showHelp() { - self::printVersionString(); - print "Usage: phpunit [switches] UnitTest [UnitTest.php]\n"; - - if (extension_loaded('xdebug')) { - print " --coverage-data Write Code Coverage data in raw format to file.\n" . - " --coverage-html Write Code Coverage data in HTML format to file.\n" . - " --coverage-text Write Code Coverage data in text format to file.\n\n"; - } - - print " --testdox-html Write agile documentation in HTML format to file.\n" . - " --testdox-text Write agile documentation in Text format to file.\n" . - " --log-xml Log test progress in XML format to file.\n\n"; - - print " --loader TestSuiteLoader implementation to use.\n\n" . - " --skeleton Generate skeleton UnitTest class for Unit in Unit.php.\n\n" . - " --wait Waits for a keystroke after each test.\n\n" . - " --help Prints this usage information.\n" . - " --version Prints the version and exits.\n"; - } - - /** - * @param boolean $wait - * @access protected - */ - protected function pause($wait) { - if (!$wait) { - return; - } - - $this->printer->printWaitPrompt(); - - fgets(STDIN); - } - - /** - * @param PHPUnit2_TextUI_ResultPrinter $resultPrinter - * @access public - */ - public function setPrinter(PHPUnit2_TextUI_ResultPrinter $resultPrinter) { - $this->printer = $resultPrinter; - } - - /** - * A test started. - * - * @param string $testName - * @access public - */ - public function testStarted($testName) { - } - - /** - * A test ended. - * - * @param string $testName - * @access public - */ - public function testEnded($testName) { - } - - /** - * A test failed. - * - * @param integer $status - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_AssertionFailedError $e - * @access public - */ - public function testFailed($status, PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { - } - - /** - * Override to define how to handle a failed loading of - * a test suite. - * - * @param string $message - * @access protected - */ - protected function runFailed($message) { - self::printVersionString(); - print $message; - exit(self::FAILURE_EXIT); - } - - /** - * @access private - * @since Method available since Release 2.2.0 - */ - private static function printVersionString() { - if (!self::$versionStringPrinted) { - print PHPUnit2_Runner_Version::getVersionString() . "\n\n"; - self::$versionStringPrinted = TRUE; - } - } -} - -if (PHPUnit2_MAIN_METHOD == 'PHPUnit2_TextUI_TestRunner::main') { - PHPUnit2_TextUI_TestRunner::main(); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: TestRunner.php,v 1.64.2.5 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +if (!defined('PHPUnit2_MAIN_METHOD')) { + define('PHPUnit2_MAIN_METHOD', 'PHPUnit2_TextUI_TestRunner::main'); +} + +require_once 'PHPUnit2/Framework/TestSuite.php'; +require_once 'PHPUnit2/Runner/Version.php'; +require_once 'PHPUnit2/Runner/BaseTestRunner.php'; +require_once 'PHPUnit2/TextUI/ResultPrinter.php'; +require_once 'PHPUnit2/Util/Fileloader.php'; + +require_once 'Console/Getopt.php'; +require_once 'Benchmark/Timer.php'; + +/** + * A TestRunner for the Command Line Interface (CLI) + * PHP SAPI Module. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_TextUI_TestRunner extends PHPUnit2_Runner_BaseTestRunner { + const SUCCESS_EXIT = 0; + const FAILURE_EXIT = 1; + const EXCEPTION_EXIT = 2; + + /** + * @var PHPUnit2_Runner_TestSuiteLoader + * @access private + */ + private $loader = NULL; + + /** + * @var PHPUnit2_TextUI_ResultPrinter + * @access private + */ + private $printer = NULL; + + /** + * @var boolean + * @access private + * @static + */ + private static $versionStringPrinted = FALSE; + + /** + * @access public + * @static + */ + public static function main() { + $aTestRunner = new PHPUnit2_TextUI_TestRunner; + + try { + $result = $aTestRunner->start($_SERVER['argv']); + + if (!$result->wasSuccessful()) { + exit(self::FAILURE_EXIT); + } + + exit(self::SUCCESS_EXIT); + } + + catch (Exception $e) { + self::printVersionString(); + print $e->getMessage(); + exit(self::EXCEPTION_EXIT); + } + } + + /** + * @param array $arguments + * @throws Exception + * @access protected + */ + protected function start($arguments) { + $coverageDataFile = FALSE; + $coverageHTMLFile = FALSE; + $coverageTextFile = FALSE; + $testdoxHTMLFile = FALSE; + $testdoxTextFile = FALSE; + $xmlLogfile = FALSE; + $wait = FALSE; + + $possibleOptions = array( + 'help', + 'loader=', + 'log-xml=', + 'skeleton', + 'testdox-html=', + 'testdox-text=', + 'version', + 'wait' + ); + + if (extension_loaded('xdebug')) { + $possibleOptions[] = 'coverage-data='; + $possibleOptions[] = 'coverage-html='; + $possibleOptions[] = 'coverage-text='; + } + + $options = Console_Getopt::getopt( + $arguments, + '', + $possibleOptions + ); + + if (PEAR::isError($options)) { + $this->showError($options->getMessage()); + } + + $test = isset($options[1][0]) ? $options[1][0] : FALSE; + $testFile = isset($options[1][1]) ? $options[1][1] : $test . '.php'; + + foreach ($options[0] as $option) { + switch ($option[0]) { + case '--coverage-data': { + $coverageDataFile = $option[1]; + } + break; + + case '--coverage-html': { + $coverageHTMLFile = $option[1]; + } + break; + + case '--coverage-text': { + $coverageTextFile = $option[1]; + } + break; + + case '--help': { + $this->showHelp(); + exit(self::SUCCESS_EXIT); + } + break; + + case '--testdox-html': { + $testdoxHTMLFile = $option[1]; + } + break; + + case '--testdox-text': { + $testdoxTextFile = $option[1]; + } + break; + + case '--loader': { + if (!class_exists($option[1])) { + PHPUnit2_Util_Fileloader::checkAndLoad( + str_replace('_', '/', $option[1]) . '.php' + ); + } + + if (class_exists($option[1])) { + $class = new ReflectionClass($option[1]); + + if ($class->implementsInterface('PHPUnit2_Runner_TestSuiteLoader') && + $class->isInstantiable()) { + $this->loader = $class->newInstance(); + } + } + + if ($this->loader === NULL) { + $this->showError( + sprintf( + 'Could not use "%s" as loader.', + + $option[1] + ) + ); + } + } + break; + + case '--log-xml': { + $xmlLogfile = $option[1]; + } + break; + + case '--skeleton': { + if ($test !== FALSE) { + self::printVersionString(); + + try { + require_once 'PHPUnit2/Util/Skeleton.php'; + + $skeleton = new PHPUnit2_Util_Skeleton($test, $testFile); + $skeleton->write(); + } + + catch (Exception $e) { + print $e->getMessage() . "\n"; + + printf( + "Could not write test class skeleton for %s to %s.\n", + $test, + $test . 'Test.php' + ); + + exit(self::FAILURE_EXIT); + } + + printf( + "Wrote test class skeleton for %s to %s.\n", + $test, + $test . 'Test.php' + ); + + exit(self::SUCCESS_EXIT); + } + } + break; + + case '--version': { + self::printVersionString(); + exit(self::SUCCESS_EXIT); + } + break; + + case '--wait': { + $wait = TRUE; + } + break; + } + } + + if ($test === FALSE) { + $this->showHelp(); + + exit(self::SUCCESS_EXIT); + } + + try { + return $this->doRun( + $this->getTest($test, $testFile), + $coverageDataFile, + $coverageHTMLFile, + $coverageTextFile, + $testdoxHTMLFile, + $testdoxTextFile, + $xmlLogfile, + $wait + ); + } + + catch (Exception $e) { + throw new Exception( + 'Could not create and run test suite: ' . $e->getMessage() + ); + } + } + + /** + * @param mixed $test + * @param mixed $coverageDataFile + * @param mixed $testdoxHTMLFile + * @param mixed $testdoxTextFile + * @param mixed $xmlLogfile + * @param boolean $wait + * @access public + * @static + */ + public static function run($test, $coverageDataFile = FALSE, $coverageHTMLFile = FALSE, $coverageTextFile = FALSE, $testdoxHTMLFile = FALSE, $testdoxTextFile = FALSE, $xmlLogfile = FALSE, $wait = FALSE) { + if ($test instanceof ReflectionClass) { + $test = new PHPUnit2_Framework_TestSuite($test); + } + + if ($test instanceof PHPUnit2_Framework_Test) { + $aTestRunner = new PHPUnit2_TextUI_TestRunner; + + return $aTestRunner->doRun( + $test, + $coverageDataFile, + $coverageHTMLFile, + $coverageTextFile, + $testdoxHTMLFile, + $testdoxTextFile, + $xmlLogfile, + $wait + ); + } + } + + /** + * Runs a single test and waits until the user types RETURN. + * + * @param PHPUnit2_Framework_Test $suite + * @access public + * @static + */ + public static function runAndWait(PHPUnit2_Framework_Test $suite) { + $aTestRunner = new PHPUnit2_TextUI_TestRunner; + + $aTestRunner->doRun( + $suite, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + TRUE + ); + } + + /** + * @return PHPUnit2_Framework_TestResult + * @access protected + */ + protected function createTestResult() { + return new PHPUnit2_Framework_TestResult; + } + + /** + * @param PHPUnit2_Framework_Test $suite + * @param mixed $coverageDataFile + * @param mixed $coverageHTMLFile + * @param mixed $coverageTextFile + * @param mixed $testdoxHTMLFile + * @param mixed $testdoxTextFile + * @param mixed $xmlLogfile + * @param boolean $wait + * @return PHPUnit2_Framework_TestResult + * @access public + */ + public function doRun(PHPUnit2_Framework_Test $suite, $coverageDataFile = FALSE, $coverageHTMLFile = FALSE, $coverageTextFile = FALSE, $testdoxHTMLFile = FALSE, $testdoxTextFile = FALSE, $xmlLogfile = FALSE, $wait = FALSE) { + $result = $this->createTestResult(); + $timer = new Benchmark_Timer; + + if ($this->printer === NULL) { + $this->printer = new PHPUnit2_TextUI_ResultPrinter; + } + + $this->printer->write( + PHPUnit2_Runner_Version::getVersionString() . "\n\n" + ); + + $result->addListener($this->printer); + + if ($testdoxHTMLFile !== FALSE || $testdoxTextFile !== FALSE) { + require_once 'PHPUnit2/Util/TestDox/ResultPrinter.php'; + + if ($testdoxHTMLFile !== FALSE) { + $result->addListener( + PHPUnit2_Util_TestDox_ResultPrinter::factory( + 'HTML', + $testdoxHTMLFile + ) + ); + } + + if ($testdoxTextFile !== FALSE) { + $result->addListener( + PHPUnit2_Util_TestDox_ResultPrinter::factory( + 'Text', + $testdoxTextFile + ) + ); + } + } + + if ($xmlLogfile !== FALSE) { + require_once 'PHPUnit2/Util/Log/XML.php'; + + $result->addListener( + new PHPUnit2_Util_Log_XML($xmlLogfile) + ); + } + + if ($coverageDataFile !== FALSE || + $coverageHTMLFile !== FALSE || + $coverageTextFile !== FALSE) { + $result->collectCodeCoverageInformation(TRUE); + } + + $timer->start(); + $suite->run($result); + $timer->stop(); + $timeElapsed = $timer->timeElapsed(); + + $this->pause($wait); + + $this->printer->printResult($result, $timeElapsed); + + $this->handleCodeCoverageInformation( + $result, + $coverageDataFile, + $coverageHTMLFile, + $coverageTextFile + ); + + return $result; + } + + /** + * Returns the loader to be used. + * + * @return PHPUnit2_Runner_TestSuiteLoader + * @access public + * @since Method available since Release 2.2.0 + */ + public function getLoader() { + if ($this->loader === NULL) { + $this->loader = new PHPUnit2_Runner_StandardTestSuiteLoader; + } + + return $this->loader; + } + + /** + * @param PHPUnit2_Framework_TestResult $result + * @param mixed $coverageDataFile + * @param mixed $coverageHTMLFile + * @param mixed $coverageTextFile + * @access protected + * @since Method available since Release 2.1.0 + */ + protected function handleCodeCoverageInformation(PHPUnit2_Framework_TestResult $result, $coverageDataFile, $coverageHTMLFile, $coverageTextFile) { + if ($coverageDataFile !== FALSE && + $fp = fopen($coverageDataFile, 'w')) { + fputs($fp, serialize($result->getCodeCoverageInformation())); + fclose($fp); + } + + if ($coverageHTMLFile !== FALSE || $coverageTextFile !== FALSE) { + require_once 'PHPUnit2/Util/CodeCoverage/Renderer.php'; + + if ($coverageHTMLFile !== FALSE) { + $renderer = PHPUnit2_Util_CodeCoverage_Renderer::factory( + 'HTML', + $result->getCodeCoverageInformation() + ); + + $renderer->renderToFile($coverageHTMLFile); + } + + if ($coverageTextFile !== FALSE) { + $renderer = PHPUnit2_Util_CodeCoverage_Renderer::factory( + 'Text', + $result->getCodeCoverageInformation() + ); + + $renderer->renderToFile($coverageTextFile); + } + } + } + + /** + * @access public + */ + public function showError($message) { + self::printVersionString(); + print $message . "\n"; + + exit(self::FAILURE_EXIT); + } + + /** + * @access public + */ + public function showHelp() { + self::printVersionString(); + print "Usage: phpunit [switches] UnitTest [UnitTest.php]\n"; + + if (extension_loaded('xdebug')) { + print " --coverage-data Write Code Coverage data in raw format to file.\n" . + " --coverage-html Write Code Coverage data in HTML format to file.\n" . + " --coverage-text Write Code Coverage data in text format to file.\n\n"; + } + + print " --testdox-html Write agile documentation in HTML format to file.\n" . + " --testdox-text Write agile documentation in Text format to file.\n" . + " --log-xml Log test progress in XML format to file.\n\n"; + + print " --loader TestSuiteLoader implementation to use.\n\n" . + " --skeleton Generate skeleton UnitTest class for Unit in Unit.php.\n\n" . + " --wait Waits for a keystroke after each test.\n\n" . + " --help Prints this usage information.\n" . + " --version Prints the version and exits.\n"; + } + + /** + * @param boolean $wait + * @access protected + */ + protected function pause($wait) { + if (!$wait) { + return; + } + + $this->printer->printWaitPrompt(); + + fgets(STDIN); + } + + /** + * @param PHPUnit2_TextUI_ResultPrinter $resultPrinter + * @access public + */ + public function setPrinter(PHPUnit2_TextUI_ResultPrinter $resultPrinter) { + $this->printer = $resultPrinter; + } + + /** + * A test started. + * + * @param string $testName + * @access public + */ + public function testStarted($testName) { + } + + /** + * A test ended. + * + * @param string $testName + * @access public + */ + public function testEnded($testName) { + } + + /** + * A test failed. + * + * @param integer $status + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_AssertionFailedError $e + * @access public + */ + public function testFailed($status, PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { + } + + /** + * Override to define how to handle a failed loading of + * a test suite. + * + * @param string $message + * @access protected + */ + protected function runFailed($message) { + self::printVersionString(); + print $message; + exit(self::FAILURE_EXIT); + } + + /** + * @access private + * @since Method available since Release 2.2.0 + */ + private static function printVersionString() { + if (!self::$versionStringPrinted) { + print PHPUnit2_Runner_Version::getVersionString() . "\n\n"; + self::$versionStringPrinted = TRUE; + } + } +} + +if (PHPUnit2_MAIN_METHOD == 'PHPUnit2_TextUI_TestRunner::main') { + PHPUnit2_TextUI_TestRunner::main(); +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer.php b/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer.php index cbcdda51..408b6850 100644 --- a/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer.php +++ b/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer.php @@ -1,225 +1,225 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Renderer.php,v 1.8.2.7 2006/02/25 17:02:23 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -/** - * Abstract base class for Code Coverage renderers. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - * @abstract - */ -abstract class PHPUnit2_Util_CodeCoverage_Renderer { - /** - * @var array - * @access protected - */ - protected $codeCoverageInformation; - - /** - * Constructor. - * - * @param array $codeCoverageInformation - * @access protected - */ - protected function __construct($codeCoverageInformation) { - $this->codeCoverageInformation = $codeCoverageInformation; - } - - /** - * Abstract Factory. - * - * @param string $rendererName - * @param array $codeCoverageInformation - * @throws Exception - * @access public - */ - public function factory($rendererName, $codeCoverageInformation) { - require_once 'PHPUnit2/Util/CodeCoverage/Renderer/' . $rendererName . '.php'; - - $class = 'PHPUnit2_Util_CodeCoverage_Renderer_' . $rendererName; - return new $class($codeCoverageInformation); - } - - /** - * Visualizes the result array of - * PHPUnit2_Framework_TestResult::getCodeCoverageInformation(). - * - * @return string - * @access public - * @final - */ - public final function render() { - $buffer = $this->header(); - - foreach ($this->getSummary() as $sourceFile => $executedLines) { - if (file_exists($sourceFile)) { - $buffer .= $this->startSourceFile($sourceFile); - $buffer .= $this->renderSourceFile(file($sourceFile), $executedLines); - $buffer .= $this->endSourceFile($sourceFile); - } - } - - return $buffer . $this->footer(); - } - - /** - * Visualizes the result array of - * PHPUnit2_Framework_TestResult::getCodeCoverageInformation() - * and writes it to a file. - * - * @param string $filename - * @access public - * @since Method available since Release 2.2.0 - */ - public function renderToFile($filename) { - if ($fp = fopen($filename, 'w')) { - fputs( - $fp, - $this->render() - ); - - fclose($fp); - } - } - - /** - * Returns summarized Code Coverage data. - * - * Format of the result array: - * - * - * array( - * "/tested/code.php" => array( - * linenumber => flag - * ) - * ) - * - * - * flag > 0: line was executed. - * flag < 0: line is executable but was not executed. - * - * @return array - * @access protected - * @since Method available since Release 2.2.0 - */ - protected function getSummary() { - $summary = array(); - - foreach ($this->codeCoverageInformation as $testCaseName => $sourceFiles) { - foreach ($sourceFiles as $sourceFile => $executedLines) { - foreach ($executedLines as $lineNumber => $flag) { - if (!isset($summary[$sourceFile][$lineNumber])) { - $summary[$sourceFile][$lineNumber] = $flag; - } - - else if ($flag > 0) { - $summary[$sourceFile][$lineNumber] = $flag; - } - } - } - } - - return $summary; - } - - /** - * @return string - * @access protected - * @since Method available since Release 2.1.1 - */ - protected function header() { - } - - /** - * @return string - * @access protected - * @since Method available since Release 2.1.1 - */ - protected function footer() { - } - - /** - * @param string $sourceFile - * @return string - * @access protected - */ - protected function startSourceFile($sourceFile) { - } - - /** - * @param string $sourceFile - * @return string - * @access protected - */ - protected function endSourceFile($sourceFile) { - } - - /** - * @param array $codeLines - * @param array $executedLines - * @return string - * @access protected - * @abstract - */ - abstract protected function renderSourceFile($codeLines, $executedLines); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Renderer.php,v 1.8.2.7 2006/02/25 17:02:23 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +/** + * Abstract base class for Code Coverage renderers. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + * @abstract + */ +abstract class PHPUnit2_Util_CodeCoverage_Renderer { + /** + * @var array + * @access protected + */ + protected $codeCoverageInformation; + + /** + * Constructor. + * + * @param array $codeCoverageInformation + * @access protected + */ + protected function __construct($codeCoverageInformation) { + $this->codeCoverageInformation = $codeCoverageInformation; + } + + /** + * Abstract Factory. + * + * @param string $rendererName + * @param array $codeCoverageInformation + * @throws Exception + * @access public + */ + public function factory($rendererName, $codeCoverageInformation) { + require_once 'PHPUnit2/Util/CodeCoverage/Renderer/' . $rendererName . '.php'; + + $class = 'PHPUnit2_Util_CodeCoverage_Renderer_' . $rendererName; + return new $class($codeCoverageInformation); + } + + /** + * Visualizes the result array of + * PHPUnit2_Framework_TestResult::getCodeCoverageInformation(). + * + * @return string + * @access public + * @final + */ + public final function render() { + $buffer = $this->header(); + + foreach ($this->getSummary() as $sourceFile => $executedLines) { + if (file_exists($sourceFile)) { + $buffer .= $this->startSourceFile($sourceFile); + $buffer .= $this->renderSourceFile(file($sourceFile), $executedLines); + $buffer .= $this->endSourceFile($sourceFile); + } + } + + return $buffer . $this->footer(); + } + + /** + * Visualizes the result array of + * PHPUnit2_Framework_TestResult::getCodeCoverageInformation() + * and writes it to a file. + * + * @param string $filename + * @access public + * @since Method available since Release 2.2.0 + */ + public function renderToFile($filename) { + if ($fp = fopen($filename, 'w')) { + fputs( + $fp, + $this->render() + ); + + fclose($fp); + } + } + + /** + * Returns summarized Code Coverage data. + * + * Format of the result array: + * + * + * array( + * "/tested/code.php" => array( + * linenumber => flag + * ) + * ) + * + * + * flag > 0: line was executed. + * flag < 0: line is executable but was not executed. + * + * @return array + * @access protected + * @since Method available since Release 2.2.0 + */ + protected function getSummary() { + $summary = array(); + + foreach ($this->codeCoverageInformation as $testCaseName => $sourceFiles) { + foreach ($sourceFiles as $sourceFile => $executedLines) { + foreach ($executedLines as $lineNumber => $flag) { + if (!isset($summary[$sourceFile][$lineNumber])) { + $summary[$sourceFile][$lineNumber] = $flag; + } + + else if ($flag > 0) { + $summary[$sourceFile][$lineNumber] = $flag; + } + } + } + } + + return $summary; + } + + /** + * @return string + * @access protected + * @since Method available since Release 2.1.1 + */ + protected function header() { + } + + /** + * @return string + * @access protected + * @since Method available since Release 2.1.1 + */ + protected function footer() { + } + + /** + * @param string $sourceFile + * @return string + * @access protected + */ + protected function startSourceFile($sourceFile) { + } + + /** + * @param string $sourceFile + * @return string + * @access protected + */ + protected function endSourceFile($sourceFile) { + } + + /** + * @param array $codeLines + * @param array $executedLines + * @return string + * @access protected + * @abstract + */ + abstract protected function renderSourceFile($codeLines, $executedLines); +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/HTML.php b/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/HTML.php index 66fc4d13..128204dc 100644 --- a/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/HTML.php +++ b/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/HTML.php @@ -1,191 +1,191 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: HTML.php,v 1.7.2.3 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -require_once 'PHPUnit2/Util/CodeCoverage/Renderer.php'; - -/** - * Renders Code Coverage information in HTML format. - * - * Formatting of the generated HTML can be achieved through - * CSS (codecoverage.css). - * - * Example - * - * - * td.ccLineNumber, td.ccCoveredLine, td.ccUncoveredLine, td.ccNotExecutableLine { - * font-family: monospace; - * white-space: pre; - * } - * - * td.ccLineNumber, td.ccCoveredLine { - * background-color: #aaaaaa; - * } - * - * td.ccNotExecutableLine { - * color: #aaaaaa; - * } - * - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ -class PHPUnit2_Util_CodeCoverage_Renderer_HTML extends PHPUnit2_Util_CodeCoverage_Renderer { - const pageHeader = -' - - - - - - -'; - - const pageFooter = -' - -'; - - const sourceFileHeader = -' -'; - - const sourceFileFooter = -'
-'; - - const codeLine = -' %s%s -'; - - /** - * @return string - * @access protected - * @since Method available since Release 2.1.1 - */ - protected function header() { - return self::pageHeader; - } - - /** - * @return string - * @access protected - * @since Method available since Release 2.1.1 - */ - protected function footer() { - return self::pageFooter; - } - - /** - * @param string $sourceFile - * @return string - * @access protected - */ - protected function startSourceFile($sourceFile) { - return self::sourceFileHeader; - } - - /** - * @param string $sourceFile - * @return string - * @access protected - */ - protected function endSourceFile($sourceFile) { - return self::sourceFileFooter; - } - - /** - * @param array $codeLines - * @param array $executedLines - * @return string - * @access protected - */ - protected function renderSourceFile($codeLines, $executedLines) { - $buffer = ''; - $line = 1; - - foreach ($codeLines as $codeLine) { - $lineStyle = 'ccNotExecutableLine'; - - if (isset($executedLines[$line])) { - if ($executedLines[$line] > 0) { - $lineStyle = 'ccCoveredLine'; - } else { - $lineStyle = 'ccUncoveredLine'; - } - } - - $buffer .= sprintf( - self::codeLine, - - $line, - $lineStyle, - htmlspecialchars(rtrim($codeLine)) - ); - - $line++; - } - - return $buffer; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: HTML.php,v 1.7.2.3 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +require_once 'PHPUnit2/Util/CodeCoverage/Renderer.php'; + +/** + * Renders Code Coverage information in HTML format. + * + * Formatting of the generated HTML can be achieved through + * CSS (codecoverage.css). + * + * Example + * + * + * td.ccLineNumber, td.ccCoveredLine, td.ccUncoveredLine, td.ccNotExecutableLine { + * font-family: monospace; + * white-space: pre; + * } + * + * td.ccLineNumber, td.ccCoveredLine { + * background-color: #aaaaaa; + * } + * + * td.ccNotExecutableLine { + * color: #aaaaaa; + * } + * + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ +class PHPUnit2_Util_CodeCoverage_Renderer_HTML extends PHPUnit2_Util_CodeCoverage_Renderer { + const pageHeader = +' + + + + + + +'; + + const pageFooter = +' + +'; + + const sourceFileHeader = +' +'; + + const sourceFileFooter = +'
+'; + + const codeLine = +' %s%s +'; + + /** + * @return string + * @access protected + * @since Method available since Release 2.1.1 + */ + protected function header() { + return self::pageHeader; + } + + /** + * @return string + * @access protected + * @since Method available since Release 2.1.1 + */ + protected function footer() { + return self::pageFooter; + } + + /** + * @param string $sourceFile + * @return string + * @access protected + */ + protected function startSourceFile($sourceFile) { + return self::sourceFileHeader; + } + + /** + * @param string $sourceFile + * @return string + * @access protected + */ + protected function endSourceFile($sourceFile) { + return self::sourceFileFooter; + } + + /** + * @param array $codeLines + * @param array $executedLines + * @return string + * @access protected + */ + protected function renderSourceFile($codeLines, $executedLines) { + $buffer = ''; + $line = 1; + + foreach ($codeLines as $codeLine) { + $lineStyle = 'ccNotExecutableLine'; + + if (isset($executedLines[$line])) { + if ($executedLines[$line] > 0) { + $lineStyle = 'ccCoveredLine'; + } else { + $lineStyle = 'ccUncoveredLine'; + } + } + + $buffer .= sprintf( + self::codeLine, + + $line, + $lineStyle, + htmlspecialchars(rtrim($codeLine)) + ); + + $line++; + } + + return $buffer; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/Text.php b/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/Text.php index 6b083692..92f3282e 100644 --- a/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/Text.php +++ b/buildscripts/PHPUnit2/Util/CodeCoverage/Renderer/Text.php @@ -1,125 +1,125 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Text.php,v 1.6.2.3 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -require_once 'PHPUnit2/Util/CodeCoverage/Renderer.php'; - -/** - * Renders Code Coverage information in text format. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ -class PHPUnit2_Util_CodeCoverage_Renderer_Text extends PHPUnit2_Util_CodeCoverage_Renderer { - /** - * @param string $sourceFile - * @return string - * @access protected - */ - protected function startSourceFile($sourceFile) { - return ' ' . $sourceFile . "\n\n"; - } - - /** - * @param string $sourceFile - * @return string - * @access protected - */ - protected function endSourceFile($sourceFile) { - return "\n"; - } - - /** - * @param array $codeLines - * @param array $executedLines - * @return string - * @access protected - */ - protected function renderSourceFile($codeLines, $executedLines) { - $buffer = ''; - $line = 1; - - foreach ($codeLines as $codeLine) { - $flag = '-'; - - if (isset($executedLines[$line])) { - if ($executedLines[$line] > 0) { - $flag = '+'; - } else { - $flag = '#'; - } - } - - $buffer .= sprintf( - ' %4u|%s| %s', - - $line, - $flag, - $codeLine - ); - - $line++; - } - - return $buffer; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Text.php,v 1.6.2.3 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +require_once 'PHPUnit2/Util/CodeCoverage/Renderer.php'; + +/** + * Renders Code Coverage information in text format. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ +class PHPUnit2_Util_CodeCoverage_Renderer_Text extends PHPUnit2_Util_CodeCoverage_Renderer { + /** + * @param string $sourceFile + * @return string + * @access protected + */ + protected function startSourceFile($sourceFile) { + return ' ' . $sourceFile . "\n\n"; + } + + /** + * @param string $sourceFile + * @return string + * @access protected + */ + protected function endSourceFile($sourceFile) { + return "\n"; + } + + /** + * @param array $codeLines + * @param array $executedLines + * @return string + * @access protected + */ + protected function renderSourceFile($codeLines, $executedLines) { + $buffer = ''; + $line = 1; + + foreach ($codeLines as $codeLine) { + $flag = '-'; + + if (isset($executedLines[$line])) { + if ($executedLines[$line] > 0) { + $flag = '+'; + } else { + $flag = '#'; + } + } + + $buffer .= sprintf( + ' %4u|%s| %s', + + $line, + $flag, + $codeLine + ); + + $line++; + } + + return $buffer; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/ErrorHandler.php b/buildscripts/PHPUnit2/Util/ErrorHandler.php index ee724ffe..450b2dd2 100644 --- a/buildscripts/PHPUnit2/Util/ErrorHandler.php +++ b/buildscripts/PHPUnit2/Util/ErrorHandler.php @@ -1,77 +1,77 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: ErrorHandler.php,v 1.1.2.2 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -/** - * @param integer $errno - * @param string $errstr - * @param string $errfile - * @param integer $errline - * @throws PHPUnit2_Framework_Error - * @since Function available since Release 2.3.0 - */ -function PHPUnit2_Util_ErrorHandler($errno, $errstr, $errfile, $errline) { - $trace = debug_backtrace(); - array_shift($trace); - - throw new PHPUnit2_Framework_Error( - $errstr, - $errno, - $errfile, - $errline, - $trace - ); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: ErrorHandler.php,v 1.1.2.2 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +/** + * @param integer $errno + * @param string $errstr + * @param string $errfile + * @param integer $errline + * @throws PHPUnit2_Framework_Error + * @since Function available since Release 2.3.0 + */ +function PHPUnit2_Util_ErrorHandler($errno, $errstr, $errfile, $errline) { + $trace = debug_backtrace(); + array_shift($trace); + + throw new PHPUnit2_Framework_Error( + $errstr, + $errno, + $errfile, + $errline, + $trace + ); +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/Fileloader.php b/buildscripts/PHPUnit2/Util/Fileloader.php index bdcd49ed..0eb45f82 100644 --- a/buildscripts/PHPUnit2/Util/Fileloader.php +++ b/buildscripts/PHPUnit2/Util/Fileloader.php @@ -1,109 +1,109 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Fileloader.php,v 1.1.2.6 2005/12/19 05:43:56 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -/** - * - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.3.0 - */ -class PHPUnit2_Util_Fileloader { - /** - * Checks if a PHP sourcefile is readable and contains no syntax errors. - * If that is the case, the sourcefile is loaded through include_once(). - * - * @param string $filename - * @throws Exception - * @access public - * @static - */ - public static function checkAndLoad($filename) { - if (!is_readable($filename)) { - $filename = './' . $filename; - } - - if (!is_readable($filename)) { - throw new Exception( - sprintf( - '%s could not be found or is not readable.', - - str_replace('./', '', $filename) - ) - ); - } - - $output = shell_exec('php -l ' . escapeshellarg($filename)); - - if (strpos($output, 'No syntax errors detected in') === FALSE) { - throw new Exception( - sprintf( - 'Syntax error in %s.', - - str_replace('./', '', $filename) - ) - ); - } - - include_once $filename; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Fileloader.php,v 1.1.2.6 2005/12/19 05:43:56 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +/** + * + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.3.0 + */ +class PHPUnit2_Util_Fileloader { + /** + * Checks if a PHP sourcefile is readable and contains no syntax errors. + * If that is the case, the sourcefile is loaded through include_once(). + * + * @param string $filename + * @throws Exception + * @access public + * @static + */ + public static function checkAndLoad($filename) { + if (!is_readable($filename)) { + $filename = './' . $filename; + } + + if (!is_readable($filename)) { + throw new Exception( + sprintf( + '%s could not be found or is not readable.', + + str_replace('./', '', $filename) + ) + ); + } + + $output = shell_exec('php -l ' . escapeshellarg($filename)); + + if (strpos($output, 'No syntax errors detected in') === FALSE) { + throw new Exception( + sprintf( + 'Syntax error in %s.', + + str_replace('./', '', $filename) + ) + ); + } + + include_once $filename; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/Filter.php b/buildscripts/PHPUnit2/Util/Filter.php index 70d055fd..c3138889 100644 --- a/buildscripts/PHPUnit2/Util/Filter.php +++ b/buildscripts/PHPUnit2/Util/Filter.php @@ -1,263 +1,263 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Filter.php,v 1.32.2.5 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -/** - * Utility class for code filtering. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - */ -class PHPUnit2_Util_Filter { - /** - * Source files that are to be filtered. - * - * @var array - * @access protected - * @static - */ - protected static $filteredFiles = array( - 'PHPUnit2/Extensions/ExceptionTestCase.php', - 'PHPUnit2/Extensions/PerformanceTestCase.php', - 'PHPUnit2/Extensions/RepeatedTest.php', - 'PHPUnit2/Extensions/TestDecorator.php', - 'PHPUnit2/Extensions/TestSetup.php', - 'PHPUnit2/Framework/Assert.php', - 'PHPUnit2/Framework/AssertionFailedError.php', - 'PHPUnit2/Framework/ComparisonFailure.php', - 'PHPUnit2/Framework/Error.php', - 'PHPUnit2/Framework/IncompleteTest.php', - 'PHPUnit2/Framework/IncompleteTestError.php', - 'PHPUnit2/Framework/Test.php', - 'PHPUnit2/Framework/TestCase.php', - 'PHPUnit2/Framework/TestFailure.php', - 'PHPUnit2/Framework/TestListener.php', - 'PHPUnit2/Framework/TestResult.php', - 'PHPUnit2/Framework/TestSuite.php', - 'PHPUnit2/Framework/Warning.php', - 'PHPUnit2/Runner/BaseTestRunner.php', - 'PHPUnit2/Runner/IncludePathTestCollector.php', - 'PHPUnit2/Runner/StandardTestSuiteLoader.php', - 'PHPUnit2/Runner/TestCollector.php', - 'PHPUnit2/Runner/TestSuiteLoader.php', - 'PHPUnit2/Runner/Version.php', - 'PHPUnit2/TextUI/ResultPrinter.php', - 'PHPUnit2/TextUI/TestRunner.php', - 'PHPUnit2/Util/CodeCoverage/Renderer/HTML.php', - 'PHPUnit2/Util/CodeCoverage/Renderer/Text.php', - 'PHPUnit2/Util/CodeCoverage/Renderer.php', - 'PHPUnit2/Util/Log/PEAR.php', - 'PHPUnit2/Util/Log/XML.php', - 'PHPUnit2/Util/TestDox/ResultPrinter/HTML.php', - 'PHPUnit2/Util/TestDox/ResultPrinter/Text.php', - 'PHPUnit2/Util/TestDox/NamePrettifier.php', - 'PHPUnit2/Util/TestDox/ResultPrinter.php', - 'PHPUnit2/Util/ErrorHandler.php', - 'PHPUnit2/Util/Fileloader.php', - 'PHPUnit2/Util/Filter.php', - 'PHPUnit2/Util/Printer.php', - 'PHPUnit2/Util/Skeleton.php', - 'Benchmark/Timer.php', - 'Console/Getopt.php', - 'Log/composite.php', - 'Log/console.php', - 'Log/display.php', - 'Log/error.php', - 'Log/file.php', - 'Log/mail.php', - 'Log/mcal.php', - 'Log/null.php', - 'Log/observer.php', - 'Log/sql.php', - 'Log/sqlite.php', - 'Log/syslog.php', - 'Log/win.php', - 'Log.php', - 'PEAR/Config.php', - 'PEAR.php' - ); - - /** - * Adds a new file to be filtered. - * - * @param string - * @access public - * @static - * @since Method available since Release 2.1.0 - */ - public static function addFileToFilter($filename) { - $filename = self::getCanonicalFilename($filename); - - if (!self::isFiltered($filename)) { - self::$filteredFiles[] = $filename; - } - } - - /** - * Removes a file from the filter. - * - * @param string - * @access public - * @static - * @since Method available since Release 2.1.0 - */ - public static function removeFileFromFilter($filename) { - $filename = self::getCanonicalFilename($filename); - $keys = array_keys(self::$filteredFiles); - - for ($i = 0; $i < sizeof($keys); $i++) { - if (self::$filteredFiles[$keys[$i]] == $filename) { - unset(self::$filteredFiles[$keys[$i]]); - break; - } - } - } - - /** - * Filters source lines from PHPUnit classes. - * - * @param array - * @return array - * @access public - * @static - */ - public static function getFilteredCodeCoverage($codeCoverageInformation) { - $files = array_keys($codeCoverageInformation); - - foreach ($files as $file) { - if (self::isFiltered($file)) { - unset($codeCoverageInformation[$file]); - } - } - - return $codeCoverageInformation; - } - - /** - * Filters stack frames from PHPUnit classes. - * - * @param Exception $e - * @return string - * @access public - * @static - */ - public static function getFilteredStacktrace(Exception $e) { - $filteredStacktrace = ''; - $stacktrace = $e->getTrace(); - - foreach ($stacktrace as $frame) { - $filtered = FALSE; - - if (isset($frame['file']) && !self::isFiltered($frame['file'])) { - $filteredStacktrace .= sprintf( - "%s:%s\n", - - $frame['file'], - isset($frame['line']) ? $frame['line'] : '?' - ); - } - } - - return $filteredStacktrace; - } - - /** - * Canonicalizes a source file name. - * - * @param string $filename - * @return string - * @access protected - * @static - */ - protected static function getCanonicalFilename($filename) { - foreach (array('PHPUnit2', 'Benchmark', 'Console', 'PEAR') as $package) { - $pos = strpos($filename, $package); - - if ($pos !== FALSE) { - $filename = substr($filename, $pos); - break; - } - } - - return str_replace( - '\\', - '/', - $filename - ); - } - - /** - * @param string $filename - * @return boolean - * @access protected - * @static - * @since Method available since Release 2.1.3 - */ - protected static function isFiltered($filename) { - if (substr($filename, -7) == 'phpunit' || - in_array(self::getCanonicalFilename($filename), self::$filteredFiles)) { - return TRUE; - } - - return FALSE; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Filter.php,v 1.32.2.5 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +/** + * Utility class for code filtering. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + */ +class PHPUnit2_Util_Filter { + /** + * Source files that are to be filtered. + * + * @var array + * @access protected + * @static + */ + protected static $filteredFiles = array( + 'PHPUnit2/Extensions/ExceptionTestCase.php', + 'PHPUnit2/Extensions/PerformanceTestCase.php', + 'PHPUnit2/Extensions/RepeatedTest.php', + 'PHPUnit2/Extensions/TestDecorator.php', + 'PHPUnit2/Extensions/TestSetup.php', + 'PHPUnit2/Framework/Assert.php', + 'PHPUnit2/Framework/AssertionFailedError.php', + 'PHPUnit2/Framework/ComparisonFailure.php', + 'PHPUnit2/Framework/Error.php', + 'PHPUnit2/Framework/IncompleteTest.php', + 'PHPUnit2/Framework/IncompleteTestError.php', + 'PHPUnit2/Framework/Test.php', + 'PHPUnit2/Framework/TestCase.php', + 'PHPUnit2/Framework/TestFailure.php', + 'PHPUnit2/Framework/TestListener.php', + 'PHPUnit2/Framework/TestResult.php', + 'PHPUnit2/Framework/TestSuite.php', + 'PHPUnit2/Framework/Warning.php', + 'PHPUnit2/Runner/BaseTestRunner.php', + 'PHPUnit2/Runner/IncludePathTestCollector.php', + 'PHPUnit2/Runner/StandardTestSuiteLoader.php', + 'PHPUnit2/Runner/TestCollector.php', + 'PHPUnit2/Runner/TestSuiteLoader.php', + 'PHPUnit2/Runner/Version.php', + 'PHPUnit2/TextUI/ResultPrinter.php', + 'PHPUnit2/TextUI/TestRunner.php', + 'PHPUnit2/Util/CodeCoverage/Renderer/HTML.php', + 'PHPUnit2/Util/CodeCoverage/Renderer/Text.php', + 'PHPUnit2/Util/CodeCoverage/Renderer.php', + 'PHPUnit2/Util/Log/PEAR.php', + 'PHPUnit2/Util/Log/XML.php', + 'PHPUnit2/Util/TestDox/ResultPrinter/HTML.php', + 'PHPUnit2/Util/TestDox/ResultPrinter/Text.php', + 'PHPUnit2/Util/TestDox/NamePrettifier.php', + 'PHPUnit2/Util/TestDox/ResultPrinter.php', + 'PHPUnit2/Util/ErrorHandler.php', + 'PHPUnit2/Util/Fileloader.php', + 'PHPUnit2/Util/Filter.php', + 'PHPUnit2/Util/Printer.php', + 'PHPUnit2/Util/Skeleton.php', + 'Benchmark/Timer.php', + 'Console/Getopt.php', + 'Log/composite.php', + 'Log/console.php', + 'Log/display.php', + 'Log/error.php', + 'Log/file.php', + 'Log/mail.php', + 'Log/mcal.php', + 'Log/null.php', + 'Log/observer.php', + 'Log/sql.php', + 'Log/sqlite.php', + 'Log/syslog.php', + 'Log/win.php', + 'Log.php', + 'PEAR/Config.php', + 'PEAR.php' + ); + + /** + * Adds a new file to be filtered. + * + * @param string + * @access public + * @static + * @since Method available since Release 2.1.0 + */ + public static function addFileToFilter($filename) { + $filename = self::getCanonicalFilename($filename); + + if (!self::isFiltered($filename)) { + self::$filteredFiles[] = $filename; + } + } + + /** + * Removes a file from the filter. + * + * @param string + * @access public + * @static + * @since Method available since Release 2.1.0 + */ + public static function removeFileFromFilter($filename) { + $filename = self::getCanonicalFilename($filename); + $keys = array_keys(self::$filteredFiles); + + for ($i = 0; $i < sizeof($keys); $i++) { + if (self::$filteredFiles[$keys[$i]] == $filename) { + unset(self::$filteredFiles[$keys[$i]]); + break; + } + } + } + + /** + * Filters source lines from PHPUnit classes. + * + * @param array + * @return array + * @access public + * @static + */ + public static function getFilteredCodeCoverage($codeCoverageInformation) { + $files = array_keys($codeCoverageInformation); + + foreach ($files as $file) { + if (self::isFiltered($file)) { + unset($codeCoverageInformation[$file]); + } + } + + return $codeCoverageInformation; + } + + /** + * Filters stack frames from PHPUnit classes. + * + * @param Exception $e + * @return string + * @access public + * @static + */ + public static function getFilteredStacktrace(Exception $e) { + $filteredStacktrace = ''; + $stacktrace = $e->getTrace(); + + foreach ($stacktrace as $frame) { + $filtered = FALSE; + + if (isset($frame['file']) && !self::isFiltered($frame['file'])) { + $filteredStacktrace .= sprintf( + "%s:%s\n", + + $frame['file'], + isset($frame['line']) ? $frame['line'] : '?' + ); + } + } + + return $filteredStacktrace; + } + + /** + * Canonicalizes a source file name. + * + * @param string $filename + * @return string + * @access protected + * @static + */ + protected static function getCanonicalFilename($filename) { + foreach (array('PHPUnit2', 'Benchmark', 'Console', 'PEAR') as $package) { + $pos = strpos($filename, $package); + + if ($pos !== FALSE) { + $filename = substr($filename, $pos); + break; + } + } + + return str_replace( + '\\', + '/', + $filename + ); + } + + /** + * @param string $filename + * @return boolean + * @access protected + * @static + * @since Method available since Release 2.1.3 + */ + protected static function isFiltered($filename) { + if (substr($filename, -7) == 'phpunit' || + in_array(self::getCanonicalFilename($filename), self::$filteredFiles)) { + return TRUE; + } + + return FALSE; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/Log/PEAR.php b/buildscripts/PHPUnit2/Util/Log/PEAR.php index 368c4f54..822b34c4 100644 --- a/buildscripts/PHPUnit2/Util/Log/PEAR.php +++ b/buildscripts/PHPUnit2/Util/Log/PEAR.php @@ -1,220 +1,220 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: PEAR.php,v 1.2.2.3 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -require_once 'PHPUnit2/Framework/TestListener.php'; - -@include_once 'Log.php'; - -/** - * A TestListener that logs to a PEAR_Log sink. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ -class PHPUnit2_Util_Log_PEAR implements PHPUnit2_Framework_TestListener { - /** - * Log. - * - * @var Log - * @access private - */ - private $log; - - /** - * @param string $type The type of concrete Log subclass to use. - * Currently, valid values are 'console', - * 'syslog', 'sql', 'file', and 'mcal'. - * @param string $name The name of the actually log file, table, or - * other specific store to use. Defaults to an - * empty string, with which the subclass will - * attempt to do something intelligent. - * @param string $ident The identity reported to the log system. - * @param array $conf A hash containing any additional configuration - * information that a subclass might need. - * @param int $maxLevel Maximum priority level at which to log. - * @access public - */ - public function __construct($type, $name = '', $ident = '', $conf = array(), $maxLevel = PEAR_LOG_DEBUG) { - $this->log = Log::factory($type, $name, $ident, $conf, $maxLevel); - } - - /** - * An error occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addError(PHPUnit2_Framework_Test $test, Exception $e) { - $this->log->crit( - sprintf( - 'Test "%s" failed: %s', - - $test->getName(), - $e->getMessage() - ) - ); - } - - /** - * A failure occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_AssertionFailedError $e - * @access public - */ - public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { - $this->log->err( - sprintf( - 'Test "%s" failed: %s', - - $test->getName(), - $e->getMessage() - ) - ); - } - - /** - * Incomplete test. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { - $this->log->info( - sprintf( - 'Test "%s" incomplete: %s', - - $test->getName(), - $e->getMessage() - ) - ); - } - - /** - * A test suite started. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { - $this->log->info( - sprintf( - 'TestSuite "%s" started.', - - $suite->getName() - ) - ); - } - - /** - * A test suite ended. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { - $this->log->info( - sprintf( - 'TestSuite "%s" ended.', - - $suite->getName() - ) - ); - } - - /** - * A test started. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function startTest(PHPUnit2_Framework_Test $test) { - $this->log->info( - sprintf( - 'Test "%s" started.', - - $test->getName() - ) - ); - } - - /** - * A test ended. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function endTest(PHPUnit2_Framework_Test $test) { - $this->log->info( - sprintf( - 'Test "%s" ended.', - - $test->getName() - ) - ); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: PEAR.php,v 1.2.2.3 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +require_once 'PHPUnit2/Framework/TestListener.php'; + +@include_once 'Log.php'; + +/** + * A TestListener that logs to a PEAR_Log sink. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ +class PHPUnit2_Util_Log_PEAR implements PHPUnit2_Framework_TestListener { + /** + * Log. + * + * @var Log + * @access private + */ + private $log; + + /** + * @param string $type The type of concrete Log subclass to use. + * Currently, valid values are 'console', + * 'syslog', 'sql', 'file', and 'mcal'. + * @param string $name The name of the actually log file, table, or + * other specific store to use. Defaults to an + * empty string, with which the subclass will + * attempt to do something intelligent. + * @param string $ident The identity reported to the log system. + * @param array $conf A hash containing any additional configuration + * information that a subclass might need. + * @param int $maxLevel Maximum priority level at which to log. + * @access public + */ + public function __construct($type, $name = '', $ident = '', $conf = array(), $maxLevel = PEAR_LOG_DEBUG) { + $this->log = Log::factory($type, $name, $ident, $conf, $maxLevel); + } + + /** + * An error occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addError(PHPUnit2_Framework_Test $test, Exception $e) { + $this->log->crit( + sprintf( + 'Test "%s" failed: %s', + + $test->getName(), + $e->getMessage() + ) + ); + } + + /** + * A failure occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_AssertionFailedError $e + * @access public + */ + public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { + $this->log->err( + sprintf( + 'Test "%s" failed: %s', + + $test->getName(), + $e->getMessage() + ) + ); + } + + /** + * Incomplete test. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { + $this->log->info( + sprintf( + 'Test "%s" incomplete: %s', + + $test->getName(), + $e->getMessage() + ) + ); + } + + /** + * A test suite started. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { + $this->log->info( + sprintf( + 'TestSuite "%s" started.', + + $suite->getName() + ) + ); + } + + /** + * A test suite ended. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { + $this->log->info( + sprintf( + 'TestSuite "%s" ended.', + + $suite->getName() + ) + ); + } + + /** + * A test started. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function startTest(PHPUnit2_Framework_Test $test) { + $this->log->info( + sprintf( + 'Test "%s" started.', + + $test->getName() + ) + ); + } + + /** + * A test ended. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function endTest(PHPUnit2_Framework_Test $test) { + $this->log->info( + sprintf( + 'Test "%s" ended.', + + $test->getName() + ) + ); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/Log/XML.php b/buildscripts/PHPUnit2/Util/Log/XML.php index ce528753..dba4c929 100644 --- a/buildscripts/PHPUnit2/Util/Log/XML.php +++ b/buildscripts/PHPUnit2/Util/Log/XML.php @@ -1,356 +1,356 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: XML.php,v 1.2.2.3 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -require_once 'PHPUnit2/Framework/TestListener.php'; -require_once 'PHPUnit2/Util/Filter.php'; -require_once 'PHPUnit2/Util/Printer.php'; - -require_once 'Benchmark/Timer.php'; - -/** - * A TestListener that generates an XML-based logfile - * of the test execution. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ -class PHPUnit2_Util_Log_XML extends PHPUnit2_Util_Printer implements PHPUnit2_Framework_TestListener { - /** - * @var DOMDocument - * @access private - */ - private $document; - - /** - * @var DOMElement - * @access private - */ - private $root; - - /** - * @var boolean - * @access private - */ - private $writeDocument = TRUE; - - /** - * @var DOMElement[] - * @access private - */ - private $testSuites = array(); - - /** - * @var integer[] - * @access private - */ - private $testSuiteTests = array(0); - - /** - * @var integer[] - * @access private - */ - private $testSuiteErrors = array(0); - - /** - * @var integer[] - * @access private - */ - private $testSuiteFailures = array(0); - - /** - * @var integer[] - * @access private - */ - private $testSuiteTimes = array(0); - - /** - * @var integer - * @access private - */ - private $testSuiteLevel = 0; - - /** - * @var DOMElement - * @access private - */ - private $currentTestCase = NULL; - - /** - * @var Benchmark_Timer - * @access private - */ - private $timer; - - /** - * Constructor. - * - * @param mixed $out - * @access public - */ - public function __construct($out = NULL) { - $this->document = new DOMDocument('1.0', 'UTF-8'); - $this->document->formatOutput = TRUE; - - $this->root = $this->document->createElement('testsuites'); - $this->document->appendChild($this->root); - - $this->timer = new Benchmark_Timer; - - parent::__construct($out); - } - - /** - * Destructor. - * - * @access public - */ - public function __destruct() { - if ($this->writeDocument === TRUE) { - $this->write($this->getXML()); - } - - parent::__destruct(); - } - - /** - * An error occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addError(PHPUnit2_Framework_Test $test, Exception $e) { - $error = $this->document->createElement('error', PHPUnit2_Util_Filter::getFilteredStacktrace($e)); - $error->setAttribute('message', $e->getMessage()); - $error->setAttribute('type', get_class($e)); - - $this->currentTestCase->appendChild($error); - - $this->testSuiteErrors[$this->testSuiteLevel]++; - } - - /** - * A failure occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_AssertionFailedError $e - * @access public - */ - public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { - $failure = $this->document->createElement('failure', PHPUnit2_Util_Filter::getFilteredStacktrace($e)); - $failure->setAttribute('message', $e->getMessage()); - $failure->setAttribute('type', get_class($e)); - - $this->currentTestCase->appendChild($failure); - - $this->testSuiteFailures[$this->testSuiteLevel]++; - } - - /** - * Incomplete test. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { - $error = $this->document->createElement('error', PHPUnit2_Util_Filter::getFilteredStacktrace($e)); - $error->setAttribute('message', 'Incomplete Test'); - $error->setAttribute('type', get_class($e)); - - $this->currentTestCase->appendChild($error); - - $this->testSuiteErrors[$this->testSuiteLevel]++; - } - - /** - * A testsuite started. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { - $testSuite = $this->document->createElement('testsuite'); - $testSuite->setAttribute('name', $suite->getName()); - - try { - $class = new ReflectionClass($suite->getName()); - $docComment = $class->getDocComment(); - - if (preg_match('/@category[\s]+([\.\w]+)/', $docComment, $matches)) { - $testSuite->setAttribute('category', $matches[1]); - } - - if (preg_match('/@package[\s]+([\.\w]+)/', $docComment, $matches)) { - $testSuite->setAttribute('package', $matches[1]); - } - - if (preg_match('/@subpackage[\s]+([\.\w]+)/', $docComment, $matches)) { - $testSuite->setAttribute('subpackage', $matches[1]); - } - } - - catch (ReflectionException $e) { - } - - if ($this->testSuiteLevel > 0) { - $this->testSuites[$this->testSuiteLevel]->appendChild($testSuite); - } else { - $this->root->appendChild($testSuite); - } - - $this->testSuiteLevel++; - $this->testSuites[$this->testSuiteLevel] = $testSuite; - $this->testSuiteTests[$this->testSuiteLevel] = 0; - $this->testSuiteErrors[$this->testSuiteLevel] = 0; - $this->testSuiteFailures[$this->testSuiteLevel] = 0; - $this->testSuiteTimes[$this->testSuiteLevel] = 0; - } - - /** - * A testsuite ended. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { - $this->testSuites[$this->testSuiteLevel]->setAttribute('tests', $this->testSuiteTests[$this->testSuiteLevel]); - $this->testSuites[$this->testSuiteLevel]->setAttribute('failures', $this->testSuiteFailures[$this->testSuiteLevel]); - $this->testSuites[$this->testSuiteLevel]->setAttribute('errors', $this->testSuiteErrors[$this->testSuiteLevel]); - $this->testSuites[$this->testSuiteLevel]->setAttribute('time', $this->testSuiteTimes[$this->testSuiteLevel]); - - if ($this->testSuiteLevel > 1) { - $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel]; - $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel]; - $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel]; - $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel]; - } - - $this->testSuiteLevel--; - } - - /** - * A test started. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function startTest(PHPUnit2_Framework_Test $test) { - $testCase = $this->document->createElement('testcase'); - $testCase->setAttribute('name', $test->getName()); - $testCase->setAttribute('class', get_class($test)); - - $this->testSuites[$this->testSuiteLevel]->appendChild($testCase); - $this->currentTestCase = $testCase; - - $this->testSuiteTests[$this->testSuiteLevel]++; - - $this->timer->start(); - } - - /** - * A test ended. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function endTest(PHPUnit2_Framework_Test $test) { - $this->timer->stop(); - $time = $this->timer->timeElapsed(); - - $this->currentTestCase->setAttribute('time', $time); - $this->testSuiteTimes[$this->testSuiteLevel] += $time; - - $this->currentTestCase = NULL; - } - - /** - * Returns the XML as a string. - * - * @return string - * @access public - * @since Method available since Release 2.2.0 - */ - public function getXML() { - return $this->document->saveXML(); - } - - /** - * Enables or disables the writing of the document - * in __destruct(). - * - * This is a "hack" needed for the integration of - * PHPUnit with Phing. - * - * @return string - * @access public - * @since Method available since Release 2.2.0 - */ - public function setWriteDocument($flag) { - if (is_bool($flag)) { - $this->writeDocument = $flag; - } - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: XML.php,v 1.2.2.3 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +require_once 'PHPUnit2/Framework/TestListener.php'; +require_once 'PHPUnit2/Util/Filter.php'; +require_once 'PHPUnit2/Util/Printer.php'; + +require_once 'Benchmark/Timer.php'; + +/** + * A TestListener that generates an XML-based logfile + * of the test execution. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ +class PHPUnit2_Util_Log_XML extends PHPUnit2_Util_Printer implements PHPUnit2_Framework_TestListener { + /** + * @var DOMDocument + * @access private + */ + private $document; + + /** + * @var DOMElement + * @access private + */ + private $root; + + /** + * @var boolean + * @access private + */ + private $writeDocument = TRUE; + + /** + * @var DOMElement[] + * @access private + */ + private $testSuites = array(); + + /** + * @var integer[] + * @access private + */ + private $testSuiteTests = array(0); + + /** + * @var integer[] + * @access private + */ + private $testSuiteErrors = array(0); + + /** + * @var integer[] + * @access private + */ + private $testSuiteFailures = array(0); + + /** + * @var integer[] + * @access private + */ + private $testSuiteTimes = array(0); + + /** + * @var integer + * @access private + */ + private $testSuiteLevel = 0; + + /** + * @var DOMElement + * @access private + */ + private $currentTestCase = NULL; + + /** + * @var Benchmark_Timer + * @access private + */ + private $timer; + + /** + * Constructor. + * + * @param mixed $out + * @access public + */ + public function __construct($out = NULL) { + $this->document = new DOMDocument('1.0', 'UTF-8'); + $this->document->formatOutput = TRUE; + + $this->root = $this->document->createElement('testsuites'); + $this->document->appendChild($this->root); + + $this->timer = new Benchmark_Timer; + + parent::__construct($out); + } + + /** + * Destructor. + * + * @access public + */ + public function __destruct() { + if ($this->writeDocument === TRUE) { + $this->write($this->getXML()); + } + + parent::__destruct(); + } + + /** + * An error occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addError(PHPUnit2_Framework_Test $test, Exception $e) { + $error = $this->document->createElement('error', PHPUnit2_Util_Filter::getFilteredStacktrace($e)); + $error->setAttribute('message', $e->getMessage()); + $error->setAttribute('type', get_class($e)); + + $this->currentTestCase->appendChild($error); + + $this->testSuiteErrors[$this->testSuiteLevel]++; + } + + /** + * A failure occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_AssertionFailedError $e + * @access public + */ + public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { + $failure = $this->document->createElement('failure', PHPUnit2_Util_Filter::getFilteredStacktrace($e)); + $failure->setAttribute('message', $e->getMessage()); + $failure->setAttribute('type', get_class($e)); + + $this->currentTestCase->appendChild($failure); + + $this->testSuiteFailures[$this->testSuiteLevel]++; + } + + /** + * Incomplete test. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { + $error = $this->document->createElement('error', PHPUnit2_Util_Filter::getFilteredStacktrace($e)); + $error->setAttribute('message', 'Incomplete Test'); + $error->setAttribute('type', get_class($e)); + + $this->currentTestCase->appendChild($error); + + $this->testSuiteErrors[$this->testSuiteLevel]++; + } + + /** + * A testsuite started. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { + $testSuite = $this->document->createElement('testsuite'); + $testSuite->setAttribute('name', $suite->getName()); + + try { + $class = new ReflectionClass($suite->getName()); + $docComment = $class->getDocComment(); + + if (preg_match('/@category[\s]+([\.\w]+)/', $docComment, $matches)) { + $testSuite->setAttribute('category', $matches[1]); + } + + if (preg_match('/@package[\s]+([\.\w]+)/', $docComment, $matches)) { + $testSuite->setAttribute('package', $matches[1]); + } + + if (preg_match('/@subpackage[\s]+([\.\w]+)/', $docComment, $matches)) { + $testSuite->setAttribute('subpackage', $matches[1]); + } + } + + catch (ReflectionException $e) { + } + + if ($this->testSuiteLevel > 0) { + $this->testSuites[$this->testSuiteLevel]->appendChild($testSuite); + } else { + $this->root->appendChild($testSuite); + } + + $this->testSuiteLevel++; + $this->testSuites[$this->testSuiteLevel] = $testSuite; + $this->testSuiteTests[$this->testSuiteLevel] = 0; + $this->testSuiteErrors[$this->testSuiteLevel] = 0; + $this->testSuiteFailures[$this->testSuiteLevel] = 0; + $this->testSuiteTimes[$this->testSuiteLevel] = 0; + } + + /** + * A testsuite ended. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { + $this->testSuites[$this->testSuiteLevel]->setAttribute('tests', $this->testSuiteTests[$this->testSuiteLevel]); + $this->testSuites[$this->testSuiteLevel]->setAttribute('failures', $this->testSuiteFailures[$this->testSuiteLevel]); + $this->testSuites[$this->testSuiteLevel]->setAttribute('errors', $this->testSuiteErrors[$this->testSuiteLevel]); + $this->testSuites[$this->testSuiteLevel]->setAttribute('time', $this->testSuiteTimes[$this->testSuiteLevel]); + + if ($this->testSuiteLevel > 1) { + $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel]; + $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel]; + $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel]; + $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel]; + } + + $this->testSuiteLevel--; + } + + /** + * A test started. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function startTest(PHPUnit2_Framework_Test $test) { + $testCase = $this->document->createElement('testcase'); + $testCase->setAttribute('name', $test->getName()); + $testCase->setAttribute('class', get_class($test)); + + $this->testSuites[$this->testSuiteLevel]->appendChild($testCase); + $this->currentTestCase = $testCase; + + $this->testSuiteTests[$this->testSuiteLevel]++; + + $this->timer->start(); + } + + /** + * A test ended. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function endTest(PHPUnit2_Framework_Test $test) { + $this->timer->stop(); + $time = $this->timer->timeElapsed(); + + $this->currentTestCase->setAttribute('time', $time); + $this->testSuiteTimes[$this->testSuiteLevel] += $time; + + $this->currentTestCase = NULL; + } + + /** + * Returns the XML as a string. + * + * @return string + * @access public + * @since Method available since Release 2.2.0 + */ + public function getXML() { + return $this->document->saveXML(); + } + + /** + * Enables or disables the writing of the document + * in __destruct(). + * + * This is a "hack" needed for the integration of + * PHPUnit with Phing. + * + * @return string + * @access public + * @since Method available since Release 2.2.0 + */ + public function setWriteDocument($flag) { + if (is_bool($flag)) { + $this->writeDocument = $flag; + } + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/Printer.php b/buildscripts/PHPUnit2/Util/Printer.php index 13dc46a9..2134f9b8 100644 --- a/buildscripts/PHPUnit2/Util/Printer.php +++ b/buildscripts/PHPUnit2/Util/Printer.php @@ -1,116 +1,116 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Printer.php,v 1.10.2.3 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.0.0 - */ - -/** - * Utility class that can print to STDOUT or write to a file. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.0.0 - * @abstract - */ -abstract class PHPUnit2_Util_Printer { - /** - * @var resource - * @access private - */ - private $out = NULL; - - /** - * Constructor. - * - * @param mixed $out - * @access public - */ - public function __construct($out = NULL) { - if ($out !== NULL) { - if (is_string($out)) { - $this->out = fopen($out, 'w'); - } else { - $this->out = $out; - } - } - } - - /** - * Destructor. - * - * @access public - */ - public function __destruct() { - if ($this->out !== NULL) { - fclose($this->out); - } - } - - /** - * @param string $buffer - * @access public - */ - public function write($buffer) { - if ($this->out !== NULL) { - fputs($this->out, $buffer); - } else { - print $buffer; - } - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Printer.php,v 1.10.2.3 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.0.0 + */ + +/** + * Utility class that can print to STDOUT or write to a file. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.0.0 + * @abstract + */ +abstract class PHPUnit2_Util_Printer { + /** + * @var resource + * @access private + */ + private $out = NULL; + + /** + * Constructor. + * + * @param mixed $out + * @access public + */ + public function __construct($out = NULL) { + if ($out !== NULL) { + if (is_string($out)) { + $this->out = fopen($out, 'w'); + } else { + $this->out = $out; + } + } + } + + /** + * Destructor. + * + * @access public + */ + public function __destruct() { + if ($this->out !== NULL) { + fclose($this->out); + } + } + + /** + * @param string $buffer + * @access public + */ + public function write($buffer) { + if ($this->out !== NULL) { + fputs($this->out, $buffer); + } else { + print $buffer; + } + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/Skeleton.php b/buildscripts/PHPUnit2/Util/Skeleton.php index 39717557..4f2d0770 100644 --- a/buildscripts/PHPUnit2/Util/Skeleton.php +++ b/buildscripts/PHPUnit2/Util/Skeleton.php @@ -1,340 +1,340 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Skeleton.php,v 1.24.2.3 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.1.0 - */ - -/** - * Class for creating a PHPUnit2_Framework_TestCase skeleton file. - * - * This class will take a classname as a parameter on construction and will - * create a PHP file that contains the skeleton of a PHPUnit2_Framework_TestCase - * subclass. - * - * - * write(); - * ?> - * - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ -class PHPUnit2_Util_Skeleton { - protected $templateClassHeader = -' -'; - - protected $templateMethod = -' - /** - * @todo Implement test{methodName}(). - */ - public function test{methodName}() { - // Remove the following line when you implement this test. - throw new PHPUnit2_Framework_IncompleteTestError; - } -'; - - /** - * @var string - * @access protected - */ - protected $className; - - /** - * @var string - * @access protected - */ - protected $classSourceFile; - - /** - * Constructor. - * - * @param string $className - * @param string $classSourceFile - * @throws Exception - * @access public - */ - public function __construct($className, $classSourceFile = '') { - if ($classSourceFile == '') { - $classSourceFile = $className . '.php'; - } - - if (file_exists($classSourceFile)) { - $this->classSourceFile = $classSourceFile; - } else { - throw new Exception( - sprintf( - 'Could not open %s.', - - $classSourceFile - ) - ); - } - - @include_once $this->classSourceFile; - - if (class_exists($className)) { - $this->className = $className; - } else { - throw new Exception( - sprintf( - 'Could not find class "%s" in %s.', - - $className, - $classSourceFile - ) - ); - } - } - - /** - * Generates the test class' source. - * - * @return string - * @access public - */ - public function generate() { - $testClassSource = $this->testClassHeader($this->className, $this->classSourceFile); - - $class = new ReflectionClass($this->className); - - foreach ($class->getMethods() as $method) { - if (!$method->isConstructor() && - !$method->isAbstract() && - $method->isUserDefined() && - $method->isPublic() && - $method->getDeclaringClass()->getName() == $this->className) { - $testClassSource .= $this->testMethod($method->getName()); - } - } - - $testClassSource .= $this->testClassFooter($this->className); - - return $testClassSource; - } - - /** - * Generates the test class and writes it to a source file. - * - * @param string $file - * @access public - */ - public function write($file = '') { - if ($file == '') { - $file = $this->className . 'Test.php'; - } - - if ($fp = @fopen($file, 'w')) { - @fputs($fp, $this->generate()); - @fclose($fp); - } - } - - /** - * Sets the templates for class header, class footer, and method. - * - * @param string $classHeader - * @param string $classFooter - * @param string $method - * @access public - * @since Method available since Release 2.2.0 - */ - public function setTemplates($classHeader, $classFooter, $method) { - if (is_file($classHeader)) { - $this->templateClassHeader = file_get_contents($classHeader); - } else { - $this->templateClassHeader = $classHeader; - } - - if (is_file($classFooter)) { - $this->templateClassFooter = file_get_contents($classFooter); - } else { - $this->templateClassFooter = $classFooter; - } - - if (is_file($method)) { - $this->templateMethod = file_get_contents($method); - } else { - $this->templateMethod = $method; - } - } - - /** - * @param string $className - * @param string $classSourceFile - * @access protected - */ - protected function testClassHeader($className, $classSourceFile) { - return str_replace( - array( - '{className}', - '{classFile}', - '{date}', - '{time}' - ), - array( - $className, - $classSourceFile, - date('Y-m-d'), - date('H:i:s') - ), - $this->templateClassHeader - ); - } - - /** - * @param string $className - * @access protected - */ - protected function testClassFooter($className) { - return str_replace( - array( - '{className}' - ), - array( - $className - ), - $this->templateClassFooter - ); - } - - /** - * @param string $methodName - * @access protected - */ - protected function testMethod($methodName) { - return str_replace( - array( - '{methodName}' - ), - array( - ucfirst($methodName) - ), - $this->templateMethod - ); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Skeleton.php,v 1.24.2.3 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.1.0 + */ + +/** + * Class for creating a PHPUnit2_Framework_TestCase skeleton file. + * + * This class will take a classname as a parameter on construction and will + * create a PHP file that contains the skeleton of a PHPUnit2_Framework_TestCase + * subclass. + * + * + * write(); + * ?> + * + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ +class PHPUnit2_Util_Skeleton { + protected $templateClassHeader = +' +'; + + protected $templateMethod = +' + /** + * @todo Implement test{methodName}(). + */ + public function test{methodName}() { + // Remove the following line when you implement this test. + throw new PHPUnit2_Framework_IncompleteTestError; + } +'; + + /** + * @var string + * @access protected + */ + protected $className; + + /** + * @var string + * @access protected + */ + protected $classSourceFile; + + /** + * Constructor. + * + * @param string $className + * @param string $classSourceFile + * @throws Exception + * @access public + */ + public function __construct($className, $classSourceFile = '') { + if ($classSourceFile == '') { + $classSourceFile = $className . '.php'; + } + + if (file_exists($classSourceFile)) { + $this->classSourceFile = $classSourceFile; + } else { + throw new Exception( + sprintf( + 'Could not open %s.', + + $classSourceFile + ) + ); + } + + @include_once $this->classSourceFile; + + if (class_exists($className)) { + $this->className = $className; + } else { + throw new Exception( + sprintf( + 'Could not find class "%s" in %s.', + + $className, + $classSourceFile + ) + ); + } + } + + /** + * Generates the test class' source. + * + * @return string + * @access public + */ + public function generate() { + $testClassSource = $this->testClassHeader($this->className, $this->classSourceFile); + + $class = new ReflectionClass($this->className); + + foreach ($class->getMethods() as $method) { + if (!$method->isConstructor() && + !$method->isAbstract() && + $method->isUserDefined() && + $method->isPublic() && + $method->getDeclaringClass()->getName() == $this->className) { + $testClassSource .= $this->testMethod($method->getName()); + } + } + + $testClassSource .= $this->testClassFooter($this->className); + + return $testClassSource; + } + + /** + * Generates the test class and writes it to a source file. + * + * @param string $file + * @access public + */ + public function write($file = '') { + if ($file == '') { + $file = $this->className . 'Test.php'; + } + + if ($fp = @fopen($file, 'w')) { + @fputs($fp, $this->generate()); + @fclose($fp); + } + } + + /** + * Sets the templates for class header, class footer, and method. + * + * @param string $classHeader + * @param string $classFooter + * @param string $method + * @access public + * @since Method available since Release 2.2.0 + */ + public function setTemplates($classHeader, $classFooter, $method) { + if (is_file($classHeader)) { + $this->templateClassHeader = file_get_contents($classHeader); + } else { + $this->templateClassHeader = $classHeader; + } + + if (is_file($classFooter)) { + $this->templateClassFooter = file_get_contents($classFooter); + } else { + $this->templateClassFooter = $classFooter; + } + + if (is_file($method)) { + $this->templateMethod = file_get_contents($method); + } else { + $this->templateMethod = $method; + } + } + + /** + * @param string $className + * @param string $classSourceFile + * @access protected + */ + protected function testClassHeader($className, $classSourceFile) { + return str_replace( + array( + '{className}', + '{classFile}', + '{date}', + '{time}' + ), + array( + $className, + $classSourceFile, + date('Y-m-d'), + date('H:i:s') + ), + $this->templateClassHeader + ); + } + + /** + * @param string $className + * @access protected + */ + protected function testClassFooter($className) { + return str_replace( + array( + '{className}' + ), + array( + $className + ), + $this->templateClassFooter + ); + } + + /** + * @param string $methodName + * @access protected + */ + protected function testMethod($methodName) { + return str_replace( + array( + '{methodName}' + ), + array( + ucfirst($methodName) + ), + $this->templateMethod + ); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/TestDox/NamePrettifier.php b/buildscripts/PHPUnit2/Util/TestDox/NamePrettifier.php index 1d686dc8..b4787a7f 100644 --- a/buildscripts/PHPUnit2/Util/TestDox/NamePrettifier.php +++ b/buildscripts/PHPUnit2/Util/TestDox/NamePrettifier.php @@ -1,165 +1,165 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: NamePrettifier.php,v 1.2.2.2 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -/** - * Prettifies class and method names for use in TestDox documentation. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ -class PHPUnit2_Util_TestDox_NamePrettifier { - /** - * @var string - * @access protected - */ - protected $prefix = 'Test'; - - /** - * @var string - * @access protected - */ - protected $suffix = 'Test'; - - /** - * Tests if a method is a test method. - * - * @param string $testMethodName - * @return boolean - * @access public - */ - public function isATestMethod($testMethodName) { - if (substr($testMethodName, 0, 4) == 'test') { - return TRUE; - } - - return FALSE; - } - - /** - * Prettifies the name of a test class. - * - * @param string $testClassName - * @return string - * @access public - */ - public function prettifyTestClass($testClassName) { - $title = $testClassName; - - if ($this->suffix !== NULL && - $this->suffix == substr($testClassName, -1 * strlen($this->suffix))) { - $title = substr($title, 0, strripos($title, $this->suffix)); - } - - if ($this->prefix !== NULL && - $this->prefix == substr($testClassName, 0, strlen($this->prefix))) { - $title = substr($title, strlen($this->prefix)); - } - - return $title; - } - - /** - * Prettifies the name of a test method. - * - * @param string $testMethodName - * @return string - * @access public - */ - public function prettifyTestMethod($testMethodName) { - $buffer = ''; - - $testMethodName = preg_replace('#\d+$#', '', $testMethodName); - - for ($i = 4; $i < strlen($testMethodName); $i++) { - if ($i > 4 && - ord($testMethodName[$i]) >= 65 && - ord($testMethodName[$i]) <= 90) { - $buffer .= ' ' . strtolower($testMethodName[$i]); - } else { - $buffer .= $testMethodName[$i]; - } - } - - return $buffer; - } - - /** - * Sets the prefix of test names. - * - * @param string $prefix - * @access public - */ - public function setPrefix($prefix) { - $this->prefix = $prefix; - } - - /** - * Sets the suffix of test names. - * - * @param string $prefix - * @access public - */ - public function setSuffix($suffix) { - $this->suffix = $suffix; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: NamePrettifier.php,v 1.2.2.2 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +/** + * Prettifies class and method names for use in TestDox documentation. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ +class PHPUnit2_Util_TestDox_NamePrettifier { + /** + * @var string + * @access protected + */ + protected $prefix = 'Test'; + + /** + * @var string + * @access protected + */ + protected $suffix = 'Test'; + + /** + * Tests if a method is a test method. + * + * @param string $testMethodName + * @return boolean + * @access public + */ + public function isATestMethod($testMethodName) { + if (substr($testMethodName, 0, 4) == 'test') { + return TRUE; + } + + return FALSE; + } + + /** + * Prettifies the name of a test class. + * + * @param string $testClassName + * @return string + * @access public + */ + public function prettifyTestClass($testClassName) { + $title = $testClassName; + + if ($this->suffix !== NULL && + $this->suffix == substr($testClassName, -1 * strlen($this->suffix))) { + $title = substr($title, 0, strripos($title, $this->suffix)); + } + + if ($this->prefix !== NULL && + $this->prefix == substr($testClassName, 0, strlen($this->prefix))) { + $title = substr($title, strlen($this->prefix)); + } + + return $title; + } + + /** + * Prettifies the name of a test method. + * + * @param string $testMethodName + * @return string + * @access public + */ + public function prettifyTestMethod($testMethodName) { + $buffer = ''; + + $testMethodName = preg_replace('#\d+$#', '', $testMethodName); + + for ($i = 4; $i < strlen($testMethodName); $i++) { + if ($i > 4 && + ord($testMethodName[$i]) >= 65 && + ord($testMethodName[$i]) <= 90) { + $buffer .= ' ' . strtolower($testMethodName[$i]); + } else { + $buffer .= $testMethodName[$i]; + } + } + + return $buffer; + } + + /** + * Sets the prefix of test names. + * + * @param string $prefix + * @access public + */ + public function setPrefix($prefix) { + $this->prefix = $prefix; + } + + /** + * Sets the suffix of test names. + * + * @param string $prefix + * @access public + */ + public function setSuffix($suffix) { + $this->suffix = $suffix; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter.php b/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter.php index 274c7309..5b47ef42 100644 --- a/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter.php +++ b/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter.php @@ -1,299 +1,299 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: ResultPrinter.php,v 1.2.2.6 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -require_once 'PHPUnit2/Framework/TestListener.php'; -require_once 'PHPUnit2/Util/TestDox/NamePrettifier.php'; -require_once 'PHPUnit2/Util/Printer.php'; - -/** - * Base class for printers of TestDox documentation. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - * @abstract - */ -abstract class PHPUnit2_Util_TestDox_ResultPrinter extends PHPUnit2_Util_Printer implements PHPUnit2_Framework_TestListener { - /** - * @var PHPUnit2_Util_TestDox_NamePrettifier - * @access protected - */ - protected $prettifier; - - /** - * @var string - * @access protected - */ - protected $testClass = ''; - - /** - * @var boolean - * @access protected - */ - protected $testFailed = FALSE; - - /** - * @var array - * @access protected - */ - protected $tests = array(); - - /** - * Constructor. - * - * @param resource $out - * @access public - */ - public function __construct($out = NULL) { - parent::__construct($out); - - $this->prettifier = new PHPUnit2_Util_TestDox_NamePrettifier; - $this->startRun(); - } - - /** - * Destructor. - * - * @access public - */ - public function __destruct() { - $this->doEndClass(); - $this->endRun(); - - parent::__destruct(); - } - - /** - * Abstract Factory. - * - * @param string $type - * @param resource $out - * @throws Exception - * @access public - * @static - */ - public static function factory($type, $out = NULL) { - require_once 'PHPUnit2/Util/TestDox/ResultPrinter/' . $type . '.php'; - - $class = 'PHPUnit2_Util_TestDox_ResultPrinter_' . $type; - return new $class($out); - } - - /** - * An error occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addError(PHPUnit2_Framework_Test $test, Exception $e) { - $this->testFailed = TRUE; - } - - /** - * A failure occurred. - * - * @param PHPUnit2_Framework_Test $test - * @param PHPUnit2_Framework_AssertionFailedError $e - * @access public - */ - public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { - $this->testFailed = TRUE; - } - - /** - * Incomplete test. - * - * @param PHPUnit2_Framework_Test $test - * @param Exception $e - * @access public - */ - public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { - $this->testFailed = TRUE; - } - - /** - * A testsuite started. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { - } - - /** - * A testsuite ended. - * - * @param PHPUnit2_Framework_TestSuite $suite - * @access public - * @since Method available since Release 2.2.0 - */ - public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { - } - - /** - * A test started. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function startTest(PHPUnit2_Framework_Test $test) { - $class = get_class($test); - - if ($this->testClass != $class) { - if ($this->testClass != '') { - $this->doEndClass(); - } - - $this->startClass($this->prettifier->prettifyTestClass($class)); - - $this->testClass = $class; - $this->tests = array(); - } - - $this->testFailed = FALSE; - } - - /** - * A test ended. - * - * @param PHPUnit2_Framework_Test $test - * @access public - */ - public function endTest(PHPUnit2_Framework_Test $test) { - $prettifiedName = $this->prettifier->prettifyTestMethod($test->getName()); - - if (!isset($this->tests[$prettifiedName])) { - if (!$this->testFailed) { - $this->tests[$prettifiedName]['success'] = 1; - $this->tests[$prettifiedName]['failure'] = 0; - } else { - $this->tests[$prettifiedName]['success'] = 0; - $this->tests[$prettifiedName]['failure'] = 1; - } - } else { - if (!$this->testFailed) { - $this->tests[$prettifiedName]['success']++; - } else { - $this->tests[$prettifiedName]['failure']++; - } - } - } - - /** - * @access private - * @since Method available since Release 2.3.0 - */ - private function doEndClass() { - foreach ($this->tests as $name => $data) { - if ($data['failure'] == 0) { - $this->onTest($name); - } - } - - $this->endClass($this->prettifier->prettifyTestClass($this->testClass)); - } - - /** - * Handler for 'start run' event. - * - * @access protected - */ - protected function startRun() { - } - - /** - * Handler for 'start class' event. - * - * @param string $name - * @access protected - * @abstract - */ - abstract protected function startClass($name); - - /** - * Handler for 'on test' event. - * - * @param string $name - * @access protected - * @abstract - */ - abstract protected function onTest($name); - - /** - * Handler for 'end class' event. - * - * @param string $name - * @access protected - * @abstract - */ - abstract protected function endClass($name); - - /** - * Handler for 'end run' event. - * - * @access protected - */ - protected function endRun() { - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: ResultPrinter.php,v 1.2.2.6 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +require_once 'PHPUnit2/Framework/TestListener.php'; +require_once 'PHPUnit2/Util/TestDox/NamePrettifier.php'; +require_once 'PHPUnit2/Util/Printer.php'; + +/** + * Base class for printers of TestDox documentation. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + * @abstract + */ +abstract class PHPUnit2_Util_TestDox_ResultPrinter extends PHPUnit2_Util_Printer implements PHPUnit2_Framework_TestListener { + /** + * @var PHPUnit2_Util_TestDox_NamePrettifier + * @access protected + */ + protected $prettifier; + + /** + * @var string + * @access protected + */ + protected $testClass = ''; + + /** + * @var boolean + * @access protected + */ + protected $testFailed = FALSE; + + /** + * @var array + * @access protected + */ + protected $tests = array(); + + /** + * Constructor. + * + * @param resource $out + * @access public + */ + public function __construct($out = NULL) { + parent::__construct($out); + + $this->prettifier = new PHPUnit2_Util_TestDox_NamePrettifier; + $this->startRun(); + } + + /** + * Destructor. + * + * @access public + */ + public function __destruct() { + $this->doEndClass(); + $this->endRun(); + + parent::__destruct(); + } + + /** + * Abstract Factory. + * + * @param string $type + * @param resource $out + * @throws Exception + * @access public + * @static + */ + public static function factory($type, $out = NULL) { + require_once 'PHPUnit2/Util/TestDox/ResultPrinter/' . $type . '.php'; + + $class = 'PHPUnit2_Util_TestDox_ResultPrinter_' . $type; + return new $class($out); + } + + /** + * An error occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addError(PHPUnit2_Framework_Test $test, Exception $e) { + $this->testFailed = TRUE; + } + + /** + * A failure occurred. + * + * @param PHPUnit2_Framework_Test $test + * @param PHPUnit2_Framework_AssertionFailedError $e + * @access public + */ + public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) { + $this->testFailed = TRUE; + } + + /** + * Incomplete test. + * + * @param PHPUnit2_Framework_Test $test + * @param Exception $e + * @access public + */ + public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e) { + $this->testFailed = TRUE; + } + + /** + * A testsuite started. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit2_Framework_TestSuite $suite) { + } + + /** + * A testsuite ended. + * + * @param PHPUnit2_Framework_TestSuite $suite + * @access public + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit2_Framework_TestSuite $suite) { + } + + /** + * A test started. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function startTest(PHPUnit2_Framework_Test $test) { + $class = get_class($test); + + if ($this->testClass != $class) { + if ($this->testClass != '') { + $this->doEndClass(); + } + + $this->startClass($this->prettifier->prettifyTestClass($class)); + + $this->testClass = $class; + $this->tests = array(); + } + + $this->testFailed = FALSE; + } + + /** + * A test ended. + * + * @param PHPUnit2_Framework_Test $test + * @access public + */ + public function endTest(PHPUnit2_Framework_Test $test) { + $prettifiedName = $this->prettifier->prettifyTestMethod($test->getName()); + + if (!isset($this->tests[$prettifiedName])) { + if (!$this->testFailed) { + $this->tests[$prettifiedName]['success'] = 1; + $this->tests[$prettifiedName]['failure'] = 0; + } else { + $this->tests[$prettifiedName]['success'] = 0; + $this->tests[$prettifiedName]['failure'] = 1; + } + } else { + if (!$this->testFailed) { + $this->tests[$prettifiedName]['success']++; + } else { + $this->tests[$prettifiedName]['failure']++; + } + } + } + + /** + * @access private + * @since Method available since Release 2.3.0 + */ + private function doEndClass() { + foreach ($this->tests as $name => $data) { + if ($data['failure'] == 0) { + $this->onTest($name); + } + } + + $this->endClass($this->prettifier->prettifyTestClass($this->testClass)); + } + + /** + * Handler for 'start run' event. + * + * @access protected + */ + protected function startRun() { + } + + /** + * Handler for 'start class' event. + * + * @param string $name + * @access protected + * @abstract + */ + abstract protected function startClass($name); + + /** + * Handler for 'on test' event. + * + * @param string $name + * @access protected + * @abstract + */ + abstract protected function onTest($name); + + /** + * Handler for 'end class' event. + * + * @param string $name + * @access protected + * @abstract + */ + abstract protected function endClass($name); + + /** + * Handler for 'end run' event. + * + * @access protected + */ + protected function endRun() { + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/HTML.php b/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/HTML.php index 505ec60d..2eda325a 100644 --- a/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/HTML.php +++ b/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/HTML.php @@ -1,120 +1,120 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: HTML.php,v 1.2.2.3 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -require_once 'PHPUnit2/Util/TestDox/ResultPrinter.php'; - -/** - * Prints TestDox documentation in HTML format. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ -class PHPUnit2_Util_TestDox_ResultPrinter_HTML extends PHPUnit2_Util_TestDox_ResultPrinter { - /** - * Handler for 'start run' event. - * - * @access protected - */ - protected function startRun() { - $this->write(''); - } - - /** - * Handler for 'start class' event. - * - * @param string $name - * @access protected - */ - protected function startClass($name) { - $this->write('

' . $name . '

    '); - } - - /** - * Handler for 'on test' event. - * - * @param string $name - * @access protected - */ - protected function onTest($name) { - $this->write('
  • ' . $name . '
  • '); - } - - /** - * Handler for 'end class' event. - * - * @param string $name - * @access protected - */ - protected function endClass($name) { - $this->write('
'); - } - - /** - * Handler for 'end run' event. - * - * @access protected - */ - protected function endRun() { - $this->write(''); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: HTML.php,v 1.2.2.3 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +require_once 'PHPUnit2/Util/TestDox/ResultPrinter.php'; + +/** + * Prints TestDox documentation in HTML format. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ +class PHPUnit2_Util_TestDox_ResultPrinter_HTML extends PHPUnit2_Util_TestDox_ResultPrinter { + /** + * Handler for 'start run' event. + * + * @access protected + */ + protected function startRun() { + $this->write(''); + } + + /** + * Handler for 'start class' event. + * + * @param string $name + * @access protected + */ + protected function startClass($name) { + $this->write('

' . $name . '

    '); + } + + /** + * Handler for 'on test' event. + * + * @param string $name + * @access protected + */ + protected function onTest($name) { + $this->write('
  • ' . $name . '
  • '); + } + + /** + * Handler for 'end class' event. + * + * @param string $name + * @access protected + */ + protected function endClass($name) { + $this->write('
'); + } + + /** + * Handler for 'end run' event. + * + * @access protected + */ + protected function endRun() { + $this->write(''); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/Text.php b/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/Text.php index cd12e525..388dab50 100644 --- a/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/Text.php +++ b/buildscripts/PHPUnit2/Util/TestDox/ResultPrinter/Text.php @@ -1,102 +1,102 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Text.php,v 1.2.2.3 2005/12/17 16:04:58 sebastian Exp $ - * @link http://pear.php.net/package/PHPUnit2 - * @since File available since Release 2.3.0 - */ - -require_once 'PHPUnit2/Util/TestDox/ResultPrinter.php'; - -/** - * Prints TestDox documentation in text format. - * - * @category Testing - * @package PHPUnit2 - * @author Sebastian Bergmann - * @copyright 2002-2006 Sebastian Bergmann - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHPUnit2 - * @since Class available since Release 2.1.0 - */ -class PHPUnit2_Util_TestDox_ResultPrinter_Text extends PHPUnit2_Util_TestDox_ResultPrinter { - /** - * Handler for 'start class' event. - * - * @param string $name - * @access protected - */ - protected function startClass($name) { - $this->write($name . "\n"); - } - - /** - * Handler for 'on test' event. - * - * @param string $name - * @access protected - */ - protected function onTest($name) { - $this->write(' - ' . $name . "\n"); - } - - /** - * Handler for 'end class' event. - * - * @param string $name - * @access protected - */ - protected function endClass($name) { - $this->write("\n"); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * c-hanging-comment-ender-p: nil - * End: - */ -?> +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version CVS: $Id: Text.php,v 1.2.2.3 2005/12/17 16:04:58 sebastian Exp $ + * @link http://pear.php.net/package/PHPUnit2 + * @since File available since Release 2.3.0 + */ + +require_once 'PHPUnit2/Util/TestDox/ResultPrinter.php'; + +/** + * Prints TestDox documentation in text format. + * + * @category Testing + * @package PHPUnit2 + * @author Sebastian Bergmann + * @copyright 2002-2006 Sebastian Bergmann + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHPUnit2 + * @since Class available since Release 2.1.0 + */ +class PHPUnit2_Util_TestDox_ResultPrinter_Text extends PHPUnit2_Util_TestDox_ResultPrinter { + /** + * Handler for 'start class' event. + * + * @param string $name + * @access protected + */ + protected function startClass($name) { + $this->write($name . "\n"); + } + + /** + * Handler for 'on test' event. + * + * @param string $name + * @access protected + */ + protected function onTest($name) { + $this->write(' - ' . $name . "\n"); + } + + /** + * Handler for 'end class' event. + * + * @param string $name + * @access protected + */ + protected function endClass($name) { + $this->write("\n"); + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ +?> diff --git a/buildscripts/chmbuilder/ChmQuickstartBuilder.php b/buildscripts/chmbuilder/ChmQuickstartBuilder.php index 43b55d12..2e517d68 100644 --- a/buildscripts/chmbuilder/ChmQuickstartBuilder.php +++ b/buildscripts/chmbuilder/ChmQuickstartBuilder.php @@ -1,439 +1,439 @@ -base = $base; - $this->output_dir = $output; - - if(!is_dir($this->output_dir) || !is_dir($this->output_dir.'/assets')) - { - @mkdir($this->output_dir); - @mkdir($this->output_dir.'/assets/'); - copy(dirname(__FILE__).'/chm_style.css', $this->output_dir.'/assets/chm_style.css'); - } - - Prado::setPathOfAlias('Output', realpath($this->output_dir)); - } - - public function buildDoc($pages) - { - foreach($pages as $section) - { - foreach($section as $page) - { - $this->parsePage($page); - } - } - } - - protected function initApp() - { - $this->app = new TApplication($this->base); - $response = new THttpResponse(); - $response->setBufferOutput(false); - $this->app->setResponse($response); - $assets = new TAssetManager(); - $assets->setBasePath('Output.assets.*'); - $this->app->setAssetManager($assets); - } - - public function parsePage($page) - { - $_GET['page'] = str_replace(array('/','.page'),array('.',''),$page); - $_GET['notheme'] = 'true'; - - $html = $this->parseHtmlContent($this->getApplicationContent()); - $file = str_replace(array('/','.page'), array('_','.html'),$page); -// echo 'writing file '.$file."\n"; - file_put_contents($this->output_dir.'/'.$file, $html); - } - - public function getApplicationContent() - { - ob_start(); - $this->initApp(); - $this->app->run(); - $content = ob_get_contents(); - ob_end_clean(); - return $content; - } - - public function parseHtmlContent($content) - { - $html = preg_replace('/]+\/>/m', '', $content); -$html = str_replace('', '', $html); -$html = preg_replace('/