From: Reini U. <ru...@x-...> - 2004-10-05 15:44:21
|
Dan Frankowski schrieb: > In general it's not good to adjust the code to pass unit tests by > exercising different code paths. Sometimes this is difficult. I know. Before I had it in the if section below, which also just returns. Userprefs is the only page where I do this to be able to finish a complete test run of SetupWiki + DumpHtml for all backends. We don't have real users and a real request on unit testing, that's the real problem why Userprefs breaks. And I caught a lot of new errors. Now only some minor problems are remaining. paging on limit, your rating code, javascript search&replace, collapsed PageChangeNotification testing. I probably wont finish PageModeration, SpamAssassinIntegration, SearchHighlight, logfile access for 1.3.11. Something for the next release. > Reini Urban wrote: >> Update of /cvsroot/phpwiki/phpwiki/lib/plugin >> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15043/plugin >> >> Modified Files: >> UserPreferences.php Log Message: >> adjust for unittests. They finally pass all tests >> >> Index: UserPreferences.php >> =================================================================== >> RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/UserPreferences.php,v >> retrieving revision 1.33 >> retrieving revision 1.34 >> diff -u -2 -b -p -d -r1.33 -r1.34 >> --- UserPreferences.php 4 Oct 2004 23:39:34 -0000 1.33 >> +++ UserPreferences.php 5 Oct 2004 00:10:49 -0000 1.34 >> @@ -67,4 +67,6 @@ extends WikiPlugin >> $args = $this->getArgs($argstr, $request); >> $user =& $request->_user; >> + if (isa($request,'MockRequest')) >> + return ''; >> if ((!$request->isActionPage($request->getArg('pagename')) >> and (!isset($user->_prefs->_method) @@ -168,4 +170,7 @@ >> extends WikiPlugin >> >> // $Log$ >> +// Revision 1.34 2004/10/05 00:10:49 rurban >> +// adjust for unittests. They finally pass all tests >> +// |