Changeset 816
- Timestamp:
- 11/19/08 19:11:33 (3 years ago)
- Location:
- trunk
- Files:
-
- 63 edited
- 6 moved
-
UnitTestContrib/data/Foswiki (moved) (moved from trunk/UnitTestContrib/data/TWiki)
-
UnitTestContrib/lib/Foswiki (moved) (moved from trunk/UnitTestContrib/lib/TWiki)
-
UnitTestContrib/lib/Foswiki/Contrib/UnitTestContrib.pm (modified) (2 diffs)
-
UnitTestContrib/lib/Foswiki/Contrib/UnitTestContrib/MANIFEST (modified) (3 diffs)
-
UnitTestContrib/lib/Foswiki/Contrib/UnitTestContrib/build.pl (modified) (1 diff)
-
UnitTestContrib/lib/Foswiki/UI/Test.pm (modified) (1 diff)
-
UnitTestContrib/lib/Unit/Request.pm (modified) (1 diff)
-
UnitTestContrib/lib/Unit/Response.pm (modified) (2 diffs)
-
UnitTestContrib/lib/Unit/TestCase.pm (modified) (2 diffs)
-
UnitTestContrib/pub/Foswiki (moved) (moved from trunk/UnitTestContrib/pub/TWiki)
-
UnitTestContrib/test/bin/TestRunner.pl (modified) (3 diffs)
-
UnitTestContrib/test/unit/AccessControlTests.pm (modified) (20 diffs)
-
UnitTestContrib/test/unit/AddToHeadTests.pm (modified) (4 diffs)
-
UnitTestContrib/test/unit/AttrsTests.pm (modified) (20 diffs)
-
UnitTestContrib/test/unit/AutoAttachTests.pm (modified) (6 diffs)
-
UnitTestContrib/test/unit/CGIEngineTests.pm (modified) (3 diffs)
-
UnitTestContrib/test/unit/ClientTests.pm (modified) (10 diffs)
-
UnitTestContrib/test/unit/ConfigureTests.pm (modified) (21 diffs)
-
UnitTestContrib/test/unit/EmptyTests.pm (modified) (4 diffs)
-
UnitTestContrib/test/unit/ExampleTests.pm (modified) (1 diff)
-
UnitTestContrib/test/unit/ExceptionTests.pm (modified) (8 diffs)
-
UnitTestContrib/test/unit/Fn_GROUPS.pm (modified) (2 diffs)
-
UnitTestContrib/test/unit/Fn_IF.pm (modified) (55 diffs)
-
UnitTestContrib/test/unit/Fn_INCLUDE.pm (modified) (3 diffs)
-
UnitTestContrib/test/unit/Fn_NOP.pm (modified) (1 diff)
-
UnitTestContrib/test/unit/Fn_REVINFO.pm (modified) (5 diffs)
-
UnitTestContrib/test/unit/Fn_SCRIPTURL.pm (modified) (2 diffs)
-
UnitTestContrib/test/unit/Fn_SEARCH.pm (modified) (6 diffs)
-
UnitTestContrib/test/unit/Fn_SECTION.pm (modified) (11 diffs)
-
UnitTestContrib/test/unit/Fn_SEP.pm (modified) (1 diff)
-
UnitTestContrib/test/unit/Fn_URLPARAM.pm (modified) (1 diff)
-
UnitTestContrib/test/unit/Fn_USERINFO.pm (modified) (5 diffs)
-
UnitTestContrib/test/unit/Fn_VAR.pm (modified) (2 diffs)
-
UnitTestContrib/test/unit/FormDefTests.pm (modified) (8 diffs)
-
UnitTestContrib/test/unit/FormattingTests.pm (modified) (17 diffs)
-
UnitTestContrib/test/unit/FoswikiFnTestCase.pm (moved) (moved from trunk/UnitTestContrib/test/unit/TWikiFnTestCase.pm) (6 diffs)
-
UnitTestContrib/test/unit/FoswikiSuite.pm (moved) (moved from trunk/UnitTestContrib/test/unit/TWikiSuite.pm) (1 diff)
-
UnitTestContrib/test/unit/FoswikiTestCase.pm (moved) (moved from trunk/UnitTestContrib/test/unit/TWikiTestCase.pm) (9 diffs)
-
UnitTestContrib/test/unit/FuncTests.pm (modified) (31 diffs)
-
UnitTestContrib/test/unit/FuncUsersTests.pm (modified) (37 diffs)
-
UnitTestContrib/test/unit/HierarchicalWebsTests.pm (modified) (25 diffs)
-
UnitTestContrib/test/unit/InitFormTests.pm (modified) (7 diffs)
-
UnitTestContrib/test/unit/Iterator.pm (modified) (13 diffs)
-
UnitTestContrib/test/unit/MergeTests.pm (modified) (6 diffs)
-
UnitTestContrib/test/unit/MetaTests.pm (modified) (12 diffs)
-
UnitTestContrib/test/unit/PasswordTests.pm (modified) (11 diffs)
-
UnitTestContrib/test/unit/PluginHandlerTests.pm (modified) (17 diffs)
-
UnitTestContrib/test/unit/PrefsTests.pm (modified) (26 diffs)
-
UnitTestContrib/test/unit/QueryTests.pm (modified) (12 diffs)
-
UnitTestContrib/test/unit/RcsTests.pm (modified) (16 diffs)
-
UnitTestContrib/test/unit/RegisterTests.pm (modified) (73 diffs)
-
UnitTestContrib/test/unit/RenameTests.pm (modified) (16 diffs)
-
UnitTestContrib/test/unit/RenderFormTests.pm (modified) (7 diffs)
-
UnitTestContrib/test/unit/RequestTests.pm (modified) (30 diffs)
-
UnitTestContrib/test/unit/ResponseTests.pm (modified) (9 diffs)
-
UnitTestContrib/test/unit/RobustnessTests.pm (modified) (14 diffs)
-
UnitTestContrib/test/unit/SaveScriptTests.pm (modified) (41 diffs)
-
UnitTestContrib/test/unit/SemiAutomaticTestCaseTests.pm (modified) (4 diffs)
-
UnitTestContrib/test/unit/StoreSmokeTests.pm (modified) (18 diffs)
-
UnitTestContrib/test/unit/StoreTests.pm (modified) (14 diffs)
-
UnitTestContrib/test/unit/TOCTests.pm (modified) (4 diffs)
-
UnitTestContrib/test/unit/TemplatesTests.pm (modified) (8 diffs)
-
UnitTestContrib/test/unit/TimeTests.pm (modified) (3 diffs)
-
UnitTestContrib/test/unit/UTF8Tests.pm (modified) (3 diffs)
-
UnitTestContrib/test/unit/UploadScriptTests.pm (modified) (8 diffs)
-
UnitTestContrib/test/unit/VariableTests.pm (modified) (4 diffs)
-
UnitTestContrib/test/unit/ViewParamSectionTests.pm (modified) (3 diffs)
-
UnitTestContrib/test/unit/ViewScriptTests.pm (modified) (2 diffs)
-
core/lib/Foswiki/LoginManager/ApacheLogin.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/lib/Foswiki/Contrib/UnitTestContrib.pm
r14 r816 1 # Contrib for TWiki Collaboration Platform, http://TWiki.org/1 # Contrib for Foswiki Collaboration Platform, http://Foswiki.org/ 2 2 # 3 3 # This program is free software; you can redistribute it and/or … … 12 12 # http://www.gnu.org/copyleft/gpl.html 13 13 14 package TWiki::Contrib::UnitTestContrib;14 package Foswiki::Contrib::UnitTestContrib; 15 15 16 16 use strict; -
trunk/UnitTestContrib/lib/Foswiki/Contrib/UnitTestContrib/MANIFEST
r15 r816 1 lib/ TWiki/Contrib/UnitTestContrib.pm 06442 lib/ TWiki/UI/Test.pm 06441 lib/Foswiki/Contrib/UnitTestContrib.pm 0644 2 lib/Foswiki/UI/Test.pm 0644 3 3 lib/Unit/Eavesdrop.pm 0644 4 4 lib/Unit/HTMLDiffer.pm 0644 … … 55 55 test/unit/StoreTests.pm 0644 56 56 test/unit/TOCTests.pm 0644 57 test/unit/ TWikiFnTestCase.pm 064458 test/unit/ TWikiSuite.pm 064459 test/unit/ TWikiTestCase.pm 064457 test/unit/FoswikiFnTestCase.pm 0644 58 test/unit/FoswikiSuite.pm 0644 59 test/unit/FoswikiTestCase.pm 0644 60 60 test/unit/TemplatesTests.pm 0644 61 61 test/unit/TimeTests.pm 0644 … … 65 65 test/unit/ViewParamSectionTests.pm 0755 66 66 test/unit/ViewScriptTests.pm 0644 67 pub/ TWiki/UnitTestContrib/wikiringlogo20x20.png 066068 pub/ TWiki/UnitTestContrib/logo.gif 066069 data/ TWiki/UnitTestContrib.txt 066067 pub/Foswiki/UnitTestContrib/wikiringlogo20x20.png 0660 68 pub/Foswiki/UnitTestContrib/logo.gif 0660 69 data/Foswiki/UnitTestContrib.txt 0660 -
trunk/UnitTestContrib/lib/Foswiki/Contrib/UnitTestContrib/build.pl
r14 r816 3 3 unshift @INC, split( /:/, $ENV{TWIKI_LIBS} ); 4 4 } 5 use TWiki::Contrib::Build;5 use Foswiki::Contrib::Build; 6 6 7 7 # Create the build object 8 $build = new TWiki::Contrib::Build('UnitTestContrib');8 $build = new Foswiki::Contrib::Build('UnitTestContrib'); 9 9 10 10 # (Optional) Set the details of the repository for uploads. -
trunk/UnitTestContrib/lib/Foswiki/UI/Test.pm
r15 r816 1 package TWiki::UI::Test;1 package Foswiki::UI::Test; 2 2 3 3 use strict; -
trunk/UnitTestContrib/lib/Unit/Request.pm
r14 r816 3 3 4 4 BEGIN { 5 use TWiki;5 use Foswiki; 6 6 use CGI; 7 my ($release) = $ TWiki::RELEASE =~ /-(\d+)\.\d+\.\d+/;8 if ( $release >= 5) {9 require TWiki::Request;10 import TWiki::Request;11 @Unit::Request::ISA = ' TWiki::Request';7 my ($release) = $Foswiki::RELEASE =~ /-(\d+)\.\d+\.\d+/; 8 if ( $release >= 2 ) { 9 require Foswiki::Request; 10 import Foswiki::Request; 11 @Unit::Request::ISA = 'Foswiki::Request'; 12 12 } 13 13 else { -
trunk/UnitTestContrib/lib/Unit/Response.pm
r14 r816 5 5 6 6 BEGIN { 7 use TWiki;7 use Foswiki; 8 8 use CGI; 9 my ($release) = $ TWiki::RELEASE =~ /-(\d+)\.\d+\.\d+/;9 my ($release) = $Foswiki::RELEASE =~ /-(\d+)\.\d+\.\d+/; 10 10 no warnings qw(redefine); 11 if ( $release >= 5) {12 require TWiki::Response;13 import TWiki::Response;14 @Unit::Response::ISA = qw( TWiki::Response);15 my $twiki_new = \& TWiki::new;16 * TWiki::new =11 if ( $release >= 2 ) { 12 require Foswiki::Response; 13 import Foswiki::Response; 14 @Unit::Response::ISA = qw(Foswiki::Response); 15 my $twiki_new = \&Foswiki::new; 16 *Foswiki::new = 17 17 sub { my $t = $twiki_new->(@_); $res = $t->{response}; return $t }; 18 18 } … … 20 20 @Unit::Response::ISA = qw(CGI); 21 21 *charset = sub { shift; CGI::charset(@_) }; 22 my $twiki_new = \& TWiki::new;23 * TWiki::new =22 my $twiki_new = \&Foswiki::new; 23 *Foswiki::new = 24 24 sub { my $t = $twiki_new->(@_); $res = $t->{cgiQuery}; return $t }; 25 25 } 26 my $twiki_finish = \& TWiki::finish;27 * TWiki::finish = sub { $twiki_finish->(@_); $res = undef; };26 my $twiki_finish = \&Foswiki::finish; 27 *Foswiki::finish = sub { $twiki_finish->(@_); $res = undef; }; 28 28 } 29 29 30 30 sub new { 31 die "You must call Unit::Response::new() *after* TWiki::new()\n"31 die "You must call Unit::Response::new() *after* Foswiki::new()\n" 32 32 unless defined $res; 33 33 bless $res, __PACKAGE__ unless $res->isa(__PACKAGE__); -
trunk/UnitTestContrib/lib/Unit/TestCase.pm
r14 r816 283 283 my @params = @_; 284 284 my $result; 285 my ( $release ) = $ TWiki::RELEASE =~ /-(\d+)\.\d+\.\d+/;285 my ( $release ) = $Foswiki::RELEASE =~ /-(\d+)\.\d+\.\d+/; 286 286 287 287 { … … 294 294 if ( $release >= 5 ) { 295 295 $response = 296 UNIVERSAL::isa( $params[0], ' TWiki' )296 UNIVERSAL::isa( $params[0], 'Foswiki' ) 297 297 ? $params[0]->{response} 298 : $ TWiki::Plugins::SESSION->{response};298 : $Foswiki::Plugins::SESSION->{response}; 299 299 300 300 # Capture headers 301 TWiki::Engine->finalizeCookies($response);301 Foswiki::Engine->finalizeCookies($response); 302 302 foreach my $header ( keys %{ $response->headers } ) { 303 303 $text .= $header . ': ' . $_ . "\x0D\x0A" -
trunk/UnitTestContrib/test/bin/TestRunner.pl
r14 r816 20 20 21 21 BEGIN { 22 $ TWiki::cfg{Engine} = 'TWiki::Engine::CGI';22 $Foswiki::cfg{Engine} = 'Foswiki::Engine::CGI'; 23 23 # root the tree 24 24 my $here = Cwd::abs_path; … … 44 44 45 45 use strict; 46 use TWiki; # If you take this out then TestRunner.pl will fail on IndigoPerl46 use Foswiki; # If you take this out then TestRunner.pl will fail on IndigoPerl 47 47 use Unit::TestRunner; 48 48 … … 87 87 if ($options{-clean}) { 88 88 require File::Path; 89 my @x = glob "$ TWiki::cfg{DataDir}/Temp*";89 my @x = glob "$Foswiki::cfg{DataDir}/Temp*"; 90 90 File::Path::rmtree([@x]) if scalar(@x); 91 @x = glob "$ TWiki::cfg{PubDir}/Temp*";91 @x = glob "$Foswiki::cfg{PubDir}/Temp*"; 92 92 File::Path::rmtree([@x]) if scalar(@x); 93 93 } 94 94 95 testForFiles($ TWiki::cfg{DataDir}.'/Temp*');96 testForFiles($ TWiki::cfg{PubDir}.'/Temp*');95 testForFiles($Foswiki::cfg{DataDir}.'/Temp*'); 96 testForFiles($Foswiki::cfg{PubDir}.'/Temp*'); 97 97 98 98 my $testrunner = Unit::TestRunner->new(); -
trunk/UnitTestContrib/test/unit/AccessControlTests.pm
r464 r816 3 3 package AccessControlTests; 4 4 5 use base qw( TWikiFnTestCase);5 use base qw(FoswikiFnTestCase); 6 6 7 7 sub new { … … 11 11 } 12 12 13 use TWiki;14 use TWiki::Access;13 use Foswiki; 14 use Foswiki::Access; 15 15 16 16 my $testTopic = "TemporaryTestTopic"; … … 26 26 my $this = shift; 27 27 $this->SUPER::set_up(); 28 $this->{twiki} = new TWiki();29 30 $currUser = $ TWiki::cfg{DefaultUserLogin};28 $this->{twiki} = new Foswiki(); 29 30 $currUser = $Foswiki::cfg{DefaultUserLogin}; 31 31 $this->{twiki}->{store}->saveTopic($this->{twiki}->{user}, 32 $ TWiki::cfg{UsersWebName},33 $ TWiki::cfg{DefaultUserWikiName},'');32 $Foswiki::cfg{UsersWebName}, 33 $Foswiki::cfg{DefaultUserWikiName},''); 34 34 $this->registerUser( 35 35 'white', 'Mr', "White", 'white@example.com'); … … 87 87 , undef); 88 88 $this->{twiki}->finish(); 89 $this->{twiki} = new TWiki();89 $this->{twiki} = new Foswiki(); 90 90 91 91 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrGreen); … … 107 107 , undef); 108 108 $this->{twiki}->finish(); 109 $this->{twiki} = new TWiki();109 $this->{twiki} = new Foswiki(); 110 110 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrGreen); 111 111 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrYellow); … … 126 126 , undef); 127 127 $this->{twiki}->finish(); 128 $this->{twiki} = new TWiki();128 $this->{twiki} = new Foswiki(); 129 129 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 130 130 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); … … 146 146 my $topicquery = new Unit::Request( "" ); 147 147 $topicquery->path_info("/$this->{test_web}/$testTopic"); 148 # renew TWiki, so WebPreferences gets re-read149 $this->{twiki}->finish(); 150 $this->{twiki} = new TWiki(undef, $topicquery);151 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 152 $this->{twiki}->finish(); 153 $this->{twiki} = new TWiki(undef, $topicquery);148 # renew Foswiki, so WebPreferences gets re-read 149 $this->{twiki}->finish(); 150 $this->{twiki} = new Foswiki(undef, $topicquery); 151 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 152 $this->{twiki}->finish(); 153 $this->{twiki} = new Foswiki(undef, $topicquery); 154 154 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); 155 155 $this->{twiki}->finish(); 156 $this->{twiki} = new TWiki(undef, $topicquery);156 $this->{twiki} = new Foswiki(undef, $topicquery); 157 157 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrYellow); 158 158 $this->{twiki}->finish(); 159 $this->{twiki} = new TWiki(undef, $topicquery);160 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrWhite); 161 $this->{twiki}->finish(); 162 $this->{twiki} = new TWiki(undef, $topicquery);159 $this->{twiki} = new Foswiki(undef, $topicquery); 160 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrWhite); 161 $this->{twiki}->finish(); 162 $this->{twiki} = new Foswiki(undef, $topicquery); 163 163 $this->DENIED($this->{test_web},$testTopic,"view",$MrBlue); 164 164 } … … 174 174 THIS 175 175 , undef); 176 # renew TWiki, so WebPreferences gets re-read177 $this->{twiki}->finish(); 178 $this->{twiki} = new TWiki();179 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 180 $this->{twiki}->finish(); 181 $this->{twiki} = new TWiki();176 # renew Foswiki, so WebPreferences gets re-read 177 $this->{twiki}->finish(); 178 $this->{twiki} = new Foswiki(); 179 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 180 $this->{twiki}->finish(); 181 $this->{twiki} = new Foswiki(); 182 182 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); 183 183 $this->{twiki}->finish(); 184 $this->{twiki} = new TWiki();184 $this->{twiki} = new Foswiki(); 185 185 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrYellow); 186 186 $this->{twiki}->finish(); 187 $this->{twiki} = new TWiki();188 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrWhite); 189 $this->{twiki}->finish(); 190 $this->{twiki} = new TWiki();187 $this->{twiki} = new Foswiki(); 188 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrWhite); 189 $this->{twiki}->finish(); 190 $this->{twiki} = new Foswiki(); 191 191 $this->DENIED($this->{test_web},$testTopic,"view",$MrBlue); 192 192 } … … 202 202 THIS 203 203 , undef); 204 # renew TWiki, so WebPreferences gets re-read205 $this->{twiki}->finish(); 206 $this->{twiki} = new TWiki();207 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 208 $this->{twiki}->finish(); 209 $this->{twiki} = new TWiki();204 # renew Foswiki, so WebPreferences gets re-read 205 $this->{twiki}->finish(); 206 $this->{twiki} = new Foswiki(); 207 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 208 $this->{twiki}->finish(); 209 $this->{twiki} = new Foswiki(); 210 210 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); 211 211 $this->{twiki}->finish(); 212 $this->{twiki} = new TWiki();212 $this->{twiki} = new Foswiki(); 213 213 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrYellow); 214 214 $this->{twiki}->finish(); 215 $this->{twiki} = new TWiki();216 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrWhite); 217 $this->{twiki}->finish(); 218 $this->{twiki} = new TWiki();215 $this->{twiki} = new Foswiki(); 216 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrWhite); 217 $this->{twiki}->finish(); 218 $this->{twiki} = new Foswiki(); 219 219 $this->DENIED($this->{test_web},$testTopic,"view",$MrBlue); 220 220 } … … 222 222 sub test_denyweb { 223 223 my $this = shift; 224 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $ TWiki::cfg{WebPrefsTopicName},224 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $Foswiki::cfg{WebPrefsTopicName}, 225 225 <<THIS 226 226 If DENYWEB is set to a list of wikiname … … 229 229 THIS 230 230 , undef); 231 # renew TWiki, so WebPreferences gets re-read232 $this->{twiki}->finish(); 233 $this->{twiki} = new TWiki();231 # renew Foswiki, so WebPreferences gets re-read 232 $this->{twiki}->finish(); 233 $this->{twiki} = new Foswiki(); 234 234 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 235 235 "Null points"); … … 244 244 my $this = shift; 245 245 $this->{twiki}->{store}->saveTopic( 246 $currUser, $this->{test_web}, $ TWiki::cfg{WebPrefsTopicName},246 $currUser, $this->{test_web}, $Foswiki::cfg{WebPrefsTopicName}, 247 247 <<THIS 248 248 If ALLOWWEB is set to a list of wikinames … … 252 252 THIS 253 253 , undef); 254 # renew TWiki, so WebPreferences gets re-read255 $this->{twiki}->finish(); 256 $this->{twiki} = new TWiki();254 # renew Foswiki, so WebPreferences gets re-read 255 $this->{twiki}->finish(); 256 $this->{twiki} = new Foswiki(); 257 257 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 258 258 "Null points"); … … 294 294 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 295 295 $this->{twiki}->finish(); 296 $this->{twiki} = new TWiki();296 $this->{twiki} = new Foswiki(); 297 297 298 298 my $text = <<THIS; … … 307 307 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 308 308 $this->{twiki}->finish(); 309 $this->{twiki} = new TWiki();310 my $meta = new TWiki::Meta($this->{twiki},$this->{test_web},$testTopic);309 $this->{twiki} = new Foswiki(); 310 my $meta = new Foswiki::Meta($this->{twiki},$this->{test_web},$testTopic); 311 311 my $args = 312 312 { … … 325 325 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 326 326 $this->{twiki}->finish(); 327 $this->{twiki} = new TWiki();328 my $meta = new TWiki::Meta($this->{twiki},$this->{test_web},$testTopic);327 $this->{twiki} = new Foswiki(); 328 my $meta = new Foswiki::Meta($this->{twiki},$this->{test_web},$testTopic); 329 329 my $args = 330 330 { … … 346 346 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 347 347 $this->{twiki}->finish(); 348 $this->{twiki} = new TWiki();348 $this->{twiki} = new Foswiki(); 349 349 my $text = <<THIS; 350 350 %META:PREFERENCE{name="ALLOWTOPICVIEW" title="ALLOWTOPICVIEW" type="Set" value="%25USERSWEB%25.MrGreen"}% … … 358 358 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 359 359 $this->{twiki}->finish(); 360 $this->{twiki} = new TWiki();361 my $meta = new TWiki::Meta($this->{twiki},$this->{test_web},$testTopic);360 $this->{twiki} = new Foswiki(); 361 my $meta = new Foswiki::Meta($this->{twiki},$this->{test_web},$testTopic); 362 362 my $args = 363 363 { … … 378 378 my $subweb = "$this->{test_web}.SubWeb"; 379 379 380 $ TWiki::cfg{EnableHierarchicalWebs} = 1;380 $Foswiki::cfg{EnableHierarchicalWebs} = 1; 381 381 $this->{twiki}->{store}->createWeb($this->{twiki}->{user}, $subweb); 382 382 $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, "Nowt"); 383 383 $this->{twiki}->{store}->saveTopic( 384 $currUser, $this->{test_web}, $ TWiki::cfg{WebPrefsTopicName},384 $currUser, $this->{test_web}, $Foswiki::cfg{WebPrefsTopicName}, 385 385 <<THIS, undef); 386 386 \t* Set ALLOWWEBVIEW = MrGreen 387 387 THIS 388 388 $this->{twiki}->{store}->saveTopic( 389 $currUser, $subweb, $ TWiki::cfg{WebPrefsTopicName},389 $currUser, $subweb, $Foswiki::cfg{WebPrefsTopicName}, 390 390 <<THIS, undef); 391 391 \t* Set ALLOWWEBVIEW = MrOrange 392 392 THIS 393 393 $this->{twiki}->finish(); 394 $this->{twiki} = new TWiki();394 $this->{twiki} = new Foswiki(); 395 395 $this->PERMITTED($subweb,$testTopic,"VIEW",$MrOrange); 396 396 $this->DENIED($subweb,$testTopic,"VIEW",$MrGreen); … … 410 410 , undef); 411 411 $this->{twiki}->finish(); 412 $this->{twiki} = new TWiki();412 $this->{twiki} = new Foswiki(); 413 413 $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 414 414 $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); -
trunk/UnitTestContrib/test/unit/AddToHeadTests.pm
r14 r816 5 5 package AddToHeadTests; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 71 71 my $topicName = $this->{test_topic}; 72 72 my $webName = $this->{test_web}; 73 TWiki::Func::addToHEAD("first", "QQQ");73 Foswiki::Func::addToHEAD("first", "QQQ"); 74 74 my $raw_tag = '%RENDERHEAD%'; 75 75 my $expected = "<!-- first --> QQQ"; … … 84 84 my $topicName = $this->{test_topic}; 85 85 my $webName = $this->{test_web}; 86 TWiki::Func::addToHEAD("first", "QQQ FIRST");87 TWiki::Func::addToHEAD("second", "QQQ SECOND", "third");88 TWiki::Func::addToHEAD("third", "QQQ THIRD");86 Foswiki::Func::addToHEAD("first", "QQQ FIRST"); 87 Foswiki::Func::addToHEAD("second", "QQQ SECOND", "third"); 88 Foswiki::Func::addToHEAD("third", "QQQ THIRD"); 89 89 my $raw_tag = '%RENDERHEAD%'; 90 90 my $expected = "<!-- first --> QQQ FIRST" … … 107 107 my $topicName = $this->{test_topic}; 108 108 my $webName = $this->{test_web}; 109 TWiki::Func::addToHEAD('PATTERN_STYLE','<link id="twikiLayoutCss" rel="stylesheet" type="text/css" href="PatternSkin/layout.css" media="all" />');109 Foswiki::Func::addToHEAD('PATTERN_STYLE','<link id="twikiLayoutCss" rel="stylesheet" type="text/css" href="PatternSkin/layout.css" media="all" />'); 110 110 my $raw_tag = '%RENDERHEAD%'; 111 111 my $expected = '<!-- PATTERN_STYLE --> <link id="twikiLayoutCss" rel="stylesheet" type="text/css" href="PatternSkin/layout.css" media="all" />'; -
trunk/UnitTestContrib/test/unit/AttrsTests.pm
r14 r816 3 3 package AttrsTests; 4 4 5 use base qw( TWikiTestCase);6 7 use TWiki::Attrs;5 use base qw(FoswikiTestCase); 6 7 use Foswiki::Attrs; 8 8 9 9 sub new { … … 15 15 my $this = shift; 16 16 17 my $attrs = TWiki::Attrs->new(undef, 1);18 $this->assert($attrs->isEmpty()); 19 $attrs = TWiki::Attrs->new("", 1);20 $this->assert($attrs->isEmpty()); 21 $attrs = TWiki::Attrs->new(" \t \n\t", 1);17 my $attrs = Foswiki::Attrs->new(undef, 1); 18 $this->assert($attrs->isEmpty()); 19 $attrs = Foswiki::Attrs->new("", 1); 20 $this->assert($attrs->isEmpty()); 21 $attrs = Foswiki::Attrs->new(" \t \n\t", 1); 22 22 $this->assert($attrs->isEmpty()); 23 23 } … … 26 26 my $this = shift; 27 27 28 my $attrs = TWiki::Attrs->new("a", 1);28 my $attrs = Foswiki::Attrs->new("a", 1); 29 29 $this->assert(!$attrs->isEmpty()); 30 30 $this->assert_not_null($attrs->{"a"}); 31 31 $this->assert_str_equals("1", $attrs->{"a"}); 32 32 33 $attrs = TWiki::Attrs->new("a12g b987", 1);33 $attrs = Foswiki::Attrs->new("a12g b987", 1); 34 34 $this->assert_not_null($attrs->remove("a12g")); 35 35 $this->assert_null($attrs->{"a12g"}); … … 38 38 $this->assert($attrs->isEmpty(), "Fail ".$attrs->stringify()); 39 39 40 $attrs = TWiki::Attrs->new("Acid AnhydrousCopperSulphate='white' X", 1);40 $attrs = Foswiki::Attrs->new("Acid AnhydrousCopperSulphate='white' X", 1); 41 41 $this->assert_not_null($attrs->remove("Acid")); 42 42 $this->assert_not_null($attrs->remove("X")); … … 48 48 my $this = shift; 49 49 50 my $attrs = TWiki::Attrs->new("\"wibble\"", 1);50 my $attrs = Foswiki::Attrs->new("\"wibble\"", 1); 51 51 $this->assert(!$attrs->isEmpty()); 52 52 $this->assert_str_equals("wibble", $attrs->remove("_DEFAULT")); … … 54 54 $this->assert($attrs->isEmpty()); 55 55 56 $attrs = TWiki::Attrs->new("\"wibble\" \"fleegle\"", 1);56 $attrs = Foswiki::Attrs->new("\"wibble\" \"fleegle\"", 1); 57 57 $this->assert_str_equals("wibble", $attrs->remove("_DEFAULT")); 58 58 $this->assert($attrs->isEmpty()); … … 62 62 my $this = shift; 63 63 64 my $attrs = TWiki::Attrs->new("var1=val1 var2= val2, var3 = 3 var4 =val4", 1);64 my $attrs = Foswiki::Attrs->new("var1=val1 var2= val2, var3 = 3 var4 =val4", 1); 65 65 $this->assert_str_equals("val1", $attrs->remove("var1")); 66 66 $this->assert_str_equals("val2", $attrs->remove("var2")); … … 73 73 my $this = shift; 74 74 75 my $attrs = TWiki::Attrs->new("var1=\\\"val1 var2= \\\'val2, var3 = 3 var4 =val4", 1);75 my $attrs = Foswiki::Attrs->new("var1=\\\"val1 var2= \\\'val2, var3 = 3 var4 =val4", 1); 76 76 $this->assert_str_equals("\"val1", $attrs->remove("var1")); 77 77 $this->assert_str_equals("\'val2", $attrs->remove("var2")); … … 84 84 my $this = shift; 85 85 86 my $attrs = TWiki::Attrs->new("var1 =\"val 1\", var2= \"val 2\" \" default \" var3 = \" val 3 \"", 1);86 my $attrs = Foswiki::Attrs->new("var1 =\"val 1\", var2= \"val 2\" \" default \" var3 = \" val 3 \"", 1); 87 87 $this->assert_str_equals("val 1", $attrs->remove("var1")); 88 88 $this->assert_str_equals("val 2", $attrs->remove("var2")); … … 95 95 my $this = shift; 96 96 97 my $attrs = TWiki::Attrs->new("var1 ='val 1', var2= 'val 2' ' default ' var3 = ' val 3 '", 1);97 my $attrs = Foswiki::Attrs->new("var1 ='val 1', var2= 'val 2' ' default ' var3 = ' val 3 '", 1); 98 98 $this->assert_str_equals("val 1", $attrs->remove("var1")); 99 99 $this->assert_str_equals("val 2", $attrs->remove("var2")); … … 106 106 my $this = shift; 107 107 108 my $attrs = TWiki::Attrs->new("a ='\"', b=\"'\" \"'\"", 1);108 my $attrs = Foswiki::Attrs->new("a ='\"', b=\"'\" \"'\"", 1); 109 109 $this->assert_str_equals("\"", $attrs->remove("a")); 110 110 $this->assert_str_equals("'", $attrs->remove("b")); 111 111 $this->assert_str_equals("'", $attrs->remove("_DEFAULT")); 112 112 $this->assert($attrs->isEmpty()); 113 $attrs = TWiki::Attrs->new("'\"'", 1);113 $attrs = Foswiki::Attrs->new("'\"'", 1); 114 114 $this->assert_str_equals("\"", $attrs->remove("_DEFAULT")); 115 115 $this->assert($attrs->isEmpty()); … … 119 119 my $this = shift; 120 120 121 my $attrs = TWiki::Attrs->new("a ='\"', b=\"'\" \"'\"", 1);121 my $attrs = Foswiki::Attrs->new("a ='\"', b=\"'\" \"'\"", 1); 122 122 my $s = $attrs->stringify(); 123 $attrs = TWiki::Attrs->new($attrs->stringify(), 1);123 $attrs = Foswiki::Attrs->new($attrs->stringify(), 1); 124 124 $this->assert_str_equals("\"", $attrs->remove("a")); 125 125 $this->assert_str_equals("'", $attrs->remove("b")); … … 133 133 my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 134 134 $this->assert_str_equals('abc def="ghi" jkl', 135 TWiki::Attrs::extractValue($s));135 Foswiki::Attrs::extractValue($s)); 136 136 } 137 137 … … 141 141 my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 142 142 $this->assert_str_equals('ghi', 143 TWiki::Attrs::extractValue($s, "def"));143 Foswiki::Attrs::extractValue($s, "def")); 144 144 } 145 145 … … 149 149 my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 150 150 $this->assert_str_equals('', 151 TWiki::Attrs::extractValue($s, "jkl"));151 Foswiki::Attrs::extractValue($s, "jkl")); 152 152 } 153 153 … … 157 157 my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 158 158 $this->assert_str_equals(' stu=', 159 TWiki::Attrs::extractValue($s, 'pqr'));159 Foswiki::Attrs::extractValue($s, 'pqr')); 160 160 } 161 161 … … 165 165 my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 166 166 $this->assert_str_equals('vwx', 167 TWiki::Attrs::extractValue($s, 'stu'));167 Foswiki::Attrs::extractValue($s, 'stu')); 168 168 } 169 169 … … 217 217 my( $this, $s ) = @_; 218 218 219 my $new = new TWiki::Attrs($s,0);219 my $new = new Foswiki::Attrs($s,0); 220 220 my %old = extractParameters($s); 221 221 … … 253 253 my $this = shift; 254 254 my $s = "\nBarf"; 255 my $new = new TWiki::Attrs($s,0);255 my $new = new Foswiki::Attrs($s,0); 256 256 $s = "Barf\n"; 257 $new = new TWiki::Attrs($s,0);257 $new = new Foswiki::Attrs($s,0); 258 258 $s = "\n"; 259 $new = new TWiki::Attrs($s,0);259 $new = new Foswiki::Attrs($s,0); 260 260 $s = "\"The\nCat\" format=\"Shat\nOn\nThe\nMat\""; 261 261 $this->check_string( $s ); … … 265 265 my $this = shift; 266 266 my $s = " Barf"; 267 my $new = new TWiki::Attrs($s,0);267 my $new = new Foswiki::Attrs($s,0); 268 268 $this->assert_str_equals($s, $new->{_RAW}); 269 269 } -
trunk/UnitTestContrib/test/unit/AutoAttachTests.pm
r492 r816 3 3 # Test cases: 4 4 # 1) Autoattach = off. Save a topic referring to an attachmentMissing that does not exist. 5 # 2) Add attachmentAdded into the attachment area for that topic, circumventing TWiki5 # 2) Add attachmentAdded into the attachment area for that topic, circumventing Foswiki 6 6 # 3) Turn autoattach = on. Ask for the list of attachments. attachmentAdded should appear. attachmentMissing should not. 7 7 8 8 package AutoAttachTests; 9 use base qw( TWikiFnTestCase);9 use base qw(FoswikiFnTestCase); 10 10 11 11 use strict; 12 use TWiki;13 use TWiki::Meta;12 use Foswiki; 13 use Foswiki::Meta; 14 14 use Error qw( :try ); 15 use TWiki::UI::Save;16 use TWiki::OopsException;15 use Foswiki::UI::Save; 16 use Foswiki::OopsException; 17 17 use Devel::Symdump; 18 18 … … 72 72 my $this = shift; 73 73 my ($topic, @filenames) = @_; 74 my $dir = $ TWiki::cfg{PubDir};74 my $dir = $Foswiki::cfg{PubDir}; 75 75 $dir = "$dir/$this->{test_web}/$topic"; 76 76 #print STDERR "DEBUG: dir=$dir\n"; … … 94 94 95 95 sub test_autoattach { 96 # print "Default AutoAttachPubFiles = $ TWiki::cfg{AutoAttachPubFiles}\n";97 $ TWiki::cfg{AutoAttachPubFiles} = 1;98 # print "AutoAttachPubFiles now = $ TWiki::cfg{AutoAttachPubFiles}\n";96 # print "Default AutoAttachPubFiles = $Foswiki::cfg{AutoAttachPubFiles}\n"; 97 $Foswiki::cfg{AutoAttachPubFiles} = 1; 98 # print "AutoAttachPubFiles now = $Foswiki::cfg{AutoAttachPubFiles}\n"; 99 99 100 100 my $this = shift; … … 103 103 $this->verify_normal_attachment($topic, "afile.txt"); 104 104 $this->verify_normal_attachment($topic, "bfile.txt"); 105 $this->addMissingAttachment($topic, 'bogusAttachment.txt', "I'm a figment of TWiki's imagination");105 $this->addMissingAttachment($topic, 'bogusAttachment.txt', "I'm a figment of Foswiki's imagination"); 106 106 $this->addMissingAttachment($topic, 'ressurectedComment.txt', 'ressurected attachment comment'); 107 107 $this->sneakAttachmentsAddedToTopic($topic, 'sneakedfile1.txt','sneakedfile2.txt', 'commavfilesshouldbeignored2.txt,v','_hiddenAttachment.txt', 'ressurectedComment.txt'); … … 169 169 $this->assert($this->{twiki}->{store}->topicExists($this->{test_web}, $topic)); 170 170 171 open( FILE, ">$ TWiki::cfg{TempfileDir}/$attachment" );171 open( FILE, ">$Foswiki::cfg{TempfileDir}/$attachment" ); 172 172 print FILE "Test attachment\n"; 173 173 close(FILE); … … 179 179 $this->{twiki}->{store}->saveAttachment( 180 180 $this->{test_web}, $topic, $attachment, $this->{test_user_wikiname}, 181 { file => "$ TWiki::cfg{TempfileDir}/$attachment", comment => 'comment 1' } );182 183 unlink "$ TWiki::cfg{TempfileDir}/$attachment";181 { file => "$Foswiki::cfg{TempfileDir}/$attachment", comment => 'comment 1' } ); 182 183 unlink "$Foswiki::cfg{TempfileDir}/$attachment"; 184 184 185 185 # Check revision number -
trunk/UnitTestContrib/test/unit/CGIEngineTests.pm
r15 r816 9 9 10 10 BEGIN { 11 $ TWiki::cfg{Engine} = 'TWiki::Engine::CGI';11 $Foswiki::cfg{Engine} = 'Foswiki::Engine::CGI'; 12 12 } 13 13 14 use TWiki;15 use TWiki::Response;16 use TWiki::UI;14 use Foswiki; 15 use Foswiki::Response; 16 use Foswiki::UI; 17 17 18 18 use File::Temp; … … 20 20 use Data::Dumper; 21 21 22 $ TWiki::cfg{SwitchBoard}{test} = [ 'TWiki::UI::Test', 'test', { test => 1 } ];22 $Foswiki::cfg{SwitchBoard}{test} = [ 'Foswiki::UI::Test', 'test', { test => 1 } ]; 23 23 24 24 sub cgi_env { … … 42 42 43 43 %ENV = cgi_env; 44 my $res = new TWiki::Response();44 my $res = new Foswiki::Response(); 45 45 $res->header(-type => 'text/plain', charset => 'iso8859-1'); 46 46 $res->body("Teste!\n"); 47 $ENV{QUERY_STRING} = 'desired_test_response='. TWiki::urlEncode(freeze($res));47 $ENV{QUERY_STRING} = 'desired_test_response='.Foswiki::urlEncode(freeze($res)); 48 48 my $out = ''; 49 49 open my $stdout, '>&', \*STDOUT; 50 50 close STDOUT; 51 51 open STDOUT, '>', \$out; 52 $ TWiki::engine->run();52 $Foswiki::engine->run(); 53 53 open STDOUT, '>&', $stdout; 54 54 $out =~ /(?:\r?\n){2}(.*)/s; -
trunk/UnitTestContrib/test/unit/ClientTests.pm
r672 r816 6 6 # LoginManager.pm compiles okay. 7 7 8 use base qw( TWikiFnTestCase);8 use base qw(FoswikiFnTestCase); 9 9 10 10 use Unit::Request; 11 11 use Error qw( :try ); 12 12 13 use TWiki;14 use TWiki::LoginManager;15 use TWiki::UI::View;16 use TWiki::UI::Edit;13 use Foswiki; 14 use Foswiki::LoginManager; 15 use Foswiki::UI::View; 16 use Foswiki::UI::Edit; 17 17 18 my $agent = $ TWiki::cfg{Register}{RegistrationAgentWikiName};18 my $agent = $Foswiki::cfg{Register}{RegistrationAgentWikiName}; 19 19 my $userLogin; 20 20 my $userWikiName; … … 32 32 33 33 sub TemplateLoginManager { 34 $ TWiki::cfg{LoginManager} = 'TWiki::LoginManager::TemplateLogin';34 $Foswiki::cfg{LoginManager} = 'Foswiki::LoginManager::TemplateLogin'; 35 35 } 36 36 37 37 sub ApacheLoginManager { 38 $ TWiki::cfg{LoginManager} = 'TWiki::LoginManager::ApacheLogin';38 $Foswiki::cfg{LoginManager} = 'Foswiki::LoginManager::ApacheLogin'; 39 39 } 40 40 41 41 sub NoLoginManager { 42 $ TWiki::cfg{LoginManager} = 'none';42 $Foswiki::cfg{LoginManager} = 'none'; 43 43 } 44 44 45 45 sub BaseUserMapping { 46 46 my $this = shift; 47 $ TWiki::cfg{UserMappingManager} = 'TWiki::Users::BaseUserMapping';47 $Foswiki::cfg{UserMappingManager} = 'Foswiki::Users::BaseUserMapping'; 48 48 $this->set_up_for_verify(); 49 49 } … … 51 51 sub TopicUserMapping { 52 52 my $this = shift; 53 $ TWiki::cfg{UserMappingManager} = 'TWiki::Users::TopicUserMapping';53 $Foswiki::cfg{UserMappingManager} = 'Foswiki::Users::TopicUserMapping'; 54 54 $this->set_up_for_verify(); 55 55 } … … 67 67 68 68 $this->{twiki}->finish() if $this->{twiki}; 69 $this->{twiki} = new TWiki(undef, new Unit::Request());70 $this->assert($ TWiki::cfg{TempfileDir} && -d $TWiki::cfg{TempfileDir});71 $ TWiki::cfg{UseClientSessions} = 1;72 $ TWiki::cfg{PasswordManager} = "TWiki::Users::HtPasswdUser";73 $ TWiki::cfg{Htpasswd}{FileName} = "$TWiki::cfg{TempfileDir}/htpasswd";74 $ TWiki::cfg{AuthScripts} = "edit";75 $ TWiki::cfg{Register}{EnableNewUserRegistration} = 1;76 $ TWiki::cfg{UsersWebName} = $this->{users_web};69 $this->{twiki} = new Foswiki(undef, new Unit::Request()); 70 $this->assert($Foswiki::cfg{TempfileDir} && -d $Foswiki::cfg{TempfileDir}); 71 $Foswiki::cfg{UseClientSessions} = 1; 72 $Foswiki::cfg{PasswordManager} = "Foswiki::Users::HtPasswdUser"; 73 $Foswiki::cfg{Htpasswd}{FileName} = "$Foswiki::cfg{TempfileDir}/htpasswd"; 74 $Foswiki::cfg{AuthScripts} = "edit"; 75 $Foswiki::cfg{Register}{EnableNewUserRegistration} = 1; 76 $Foswiki::cfg{UsersWebName} = $this->{users_web}; 77 77 } 78 78 … … 85 85 $this->annotate("create $userLogin user - cUID = $user_id\n"); 86 86 } else { 87 $userLogin = $ TWiki::cfg{AdminUserLogin};87 $userLogin = $Foswiki::cfg{AdminUserLogin}; 88 88 $user_id = $this->{twiki}->{users}->getCanonicalUserID($userLogin); 89 89 $userWikiName = $this->{twiki}->{users}->getWikiName($user_id); … … 106 106 my ( $query, $text ); 107 107 108 #close this TWiki session - its using the wrong mapper and login108 #close this Foswiki session - its using the wrong mapper and login 109 109 $this->{twiki}->finish(); 110 110 111 111 $query = new Unit::Request(); 112 112 $query->path_info( "/$this->{test_web}/$this->{test_topic}" ); 113 $this->{twiki} = new TWiki( undef, $query );113 $this->{twiki} = new Foswiki( undef, $query ); 114 114 115 115 $this->set_up_user(); 116 116 try { 117 $text = $this->capture( \& TWiki::UI::View::view, $this->{twiki} );118 } catch TWiki::OopsException with {117 $text = $this->capture( \&Foswiki::UI::View::view, $this->{twiki} ); 118 } catch Foswiki::OopsException with { 119 119 $this->assert(0,shift->stringify()); 120 120 } catch Error::Simple with { … … 126 126 $this->{twiki}->finish(); 127 127 128 $this->{twiki} = new TWiki( undef, $query );128 $this->{twiki} = new Foswiki( undef, $query ); 129 129 130 130 try { 131 $text = $this->capture( \& TWiki::UI::Edit::edit, $this->{twiki} );132 } catch TWiki::AccessControlException with {131 $text = $this->capture( \&Foswiki::UI::Edit::edit, $this->{twiki} ); 132 } catch Foswiki::AccessControlException with { 133 133 } catch Error::Simple with { 134 134 $this->assert(0,shift->stringify()); 135 135 } otherwise { 136 unless( $ TWiki::cfg{LoginManager} eq 'none' ) {136 unless( $Foswiki::cfg{LoginManager} eq 'none' ) { 137 137 $this->assert(0, "expected an access control exception: ". 138 $ TWiki::cfg{LoginManager}."\n$text");138 $Foswiki::cfg{LoginManager}."\n$text"); 139 139 } 140 140 }; … … 146 146 $this->annotate("new session using $userLogin\n"); 147 147 148 $this->{twiki} = new TWiki( $userLogin, $query );148 $this->{twiki} = new Foswiki( $userLogin, $query ); 149 149 150 150 #clear the lease - one of the previous tests may have different usermapper & thus different user 151 TWiki::Func::setTopicEditLock($this->{test_web}, $this->{test_topic}, 0);151 Foswiki::Func::setTopicEditLock($this->{test_web}, $this->{test_topic}, 0); 152 152 } 153 153 … … 161 161 my $secret = "a big mole on my left buttock"; 162 162 my $crypted = crypt($secret, "12"); 163 $ TWiki::cfg{Password} = $crypted;163 $Foswiki::cfg{Password} = $crypted; 164 164 165 165 my $query = new Unit::Request({ 166 username => [ $ TWiki::cfg{AdminUserLogin} ],166 username => [ $Foswiki::cfg{AdminUserLogin} ], 167 167 password => [ $secret ], 168 168 Logon => [ 1 ], … … 171 171 $query->path_info( "/$this->{test_web}/$this->{test_topic}" ); 172 172 173 $this->{twiki} = new TWiki(undef, $query);173 $this->{twiki} = new Foswiki(undef, $query); 174 174 my ($text, $result) = $this->capture( 175 175 sub { -
trunk/UnitTestContrib/test/unit/ConfigureTests.pm
r14 r816 3 3 use strict; 4 4 5 use base qw( TWikiTestCase);5 use base qw(FoswikiTestCase); 6 6 7 7 use Error qw( :try ); 8 8 use File::Temp; 9 9 10 use TWiki::Configure::TWikiCfg;11 use TWiki::Configure::Root;12 use TWiki::Configure::Valuer;13 use TWiki::Configure::UI;10 use Foswiki::Configure::FoswikiCfg; 11 use Foswiki::Configure::Root; 12 use Foswiki::Configure::Valuer; 13 use Foswiki::Configure::UI; 14 14 15 15 # Parse a cfg; change some values; save the changes … … 20 20 my %cfg = (guff=>"muff"); 21 21 22 my $valuer = new TWiki::Configure::Valuer(\%defaultCfg, \%cfg);23 my $root = new TWiki::Configure::Root();22 my $valuer = new Foswiki::Configure::Valuer(\%defaultCfg, \%cfg); 23 my $root = new Foswiki::Configure::Root(); 24 24 my ($fh, $fhname) = File::Temp::tempfile(unlink=>1); 25 25 print $fh <<'EXAMPLE'; … … 45 45 #---+ Three 46 46 # ---++++ Three.1.1.One 47 # **SELECTCLASS TWiki::Configure::Types::***48 $cfg{Types}{Chosen} = ' TWiki::Configure::Types::BOOLEAN';47 # **SELECTCLASS Foswiki::Configure::Types::*** 48 $cfg{Types}{Chosen} = 'Foswiki::Configure::Types::BOOLEAN'; 49 49 1; 50 50 EXAMPLE … … 56 56 } 57 57 58 TWiki::Configure::TWikiCfg::_parse($fhname, $root, 1);58 Foswiki::Configure::FoswikiCfg::_parse($fhname, $root, 1); 59 59 60 60 # nothing should have changed 61 my $saver = new TWiki::Configure::TWikiCfg();61 my $saver = new Foswiki::Configure::FoswikiCfg(); 62 62 $saver->{valuer} = $valuer; 63 63 $saver->{root} = $root; … … 69 69 $cfg{MandatoryPath} = 'fixed'; 70 70 $cfg{MandatoryBoolean} = 0; 71 $cfg{Types}{Chosen} = ' TWiki::Configure::Types::STRING';71 $cfg{Types}{Chosen} = 'Foswiki::Configure::Types::STRING'; 72 72 $cfg{OptionalRegex} = qr/^X*$/; 73 73 $cfg{DontIgnore} = 'now is'; … … 75 75 $out = $saver->_save(); 76 76 my $expectacle = <<'EXAMPLE'; 77 $ TWiki::cfg{MandatoryBoolean} = 0;78 $ TWiki::cfg{MandatoryPath} = 'fixed';79 $ TWiki::cfg{OptionalRegex} = '^X*$';80 $ TWiki::cfg{DontIgnore} = 'now is';81 $ TWiki::cfg{Types}{Chosen} = 'TWiki::Configure::Types::STRING';77 $Foswiki::cfg{MandatoryBoolean} = 0; 78 $Foswiki::cfg{MandatoryPath} = 'fixed'; 79 $Foswiki::cfg{OptionalRegex} = '^X*$'; 80 $Foswiki::cfg{DontIgnore} = 'now is'; 81 $Foswiki::cfg{Types}{Chosen} = 'Foswiki::Configure::Types::STRING'; 82 82 1; 83 83 EXAMPLE … … 92 92 sub test_2parse { 93 93 my $this = shift; 94 my $root = new TWiki::Configure::Root();94 my $root = new Foswiki::Configure::Root(); 95 95 96 96 $this->assert_null($root->getValueObject('{One}')); … … 100 100 print $f1 <<'EXAMPLE'; 101 101 # **STRING 10** 102 $ TWiki::cfg{One} = 'One';103 1; 104 EXAMPLE 105 $f1->close(); 106 TWiki::Configure::TWikiCfg::_parse($f1name, $root);102 $Foswiki::cfg{One} = 'One'; 103 1; 104 EXAMPLE 105 $f1->close(); 106 Foswiki::Configure::FoswikiCfg::_parse($f1name, $root); 107 107 108 108 $this->assert_not_null($root->getValueObject('{One}')); … … 112 112 print $f2 <<'EXAMPLE'; 113 113 # **STRING 10** 114 $ TWiki::cfg{Two} = 'Two';114 $Foswiki::cfg{Two} = 'Two'; 115 115 1; 116 116 EXAMPLE 117 117 $f2->close(); 118 TWiki::Configure::TWikiCfg::_parse($f2name, $root);118 Foswiki::Configure::FoswikiCfg::_parse($f2name, $root); 119 119 120 120 # make sure they are both present … … 125 125 sub test_loadpluggables { 126 126 my $this = shift; 127 my $root = new TWiki::Configure::Root();127 my $root = new Foswiki::Configure::Root(); 128 128 my ($f1, $f1name) = File::Temp::tempfile(unlink=>1); 129 129 print $f1 <<'EXAMPLE'; 130 130 # *LANGUAGES* 131 131 # *PLUGINS* 132 $ TWiki::cfg{Plugins}{CommentPlugin}{Enabled} = 0;133 1; 134 EXAMPLE 135 $f1->close(); 136 TWiki::Configure::TWikiCfg::_parse($f1name, $root);132 $Foswiki::cfg{Plugins}{CommentPlugin}{Enabled} = 0; 133 1; 134 EXAMPLE 135 $f1->close(); 136 Foswiki::Configure::FoswikiCfg::_parse($f1name, $root); 137 137 my $vo = $root->getValueObject('{Plugins}{CommentPlugin}{Enabled}'); 138 138 $this->assert_not_null($vo); … … 147 147 my $this = shift; 148 148 149 my $root = new TWiki::Configure::Root();149 my $root = new Foswiki::Configure::Root(); 150 150 151 151 my ($f1, $f1name) = File::Temp::tempfile(unlink=>1); … … 153 153 # **STRING 10** 154 154 # Good description 155 $ TWiki::cfg{One} = 'One';156 $ TWiki::cfg{Two} = 'One';157 1; 158 EXAMPLE 159 $f1->close(); 160 TWiki::Configure::TWikiCfg::_parse($f1name, $root);155 $Foswiki::cfg{One} = 'One'; 156 $Foswiki::cfg{Two} = 'One'; 157 1; 158 EXAMPLE 159 $f1->close(); 160 Foswiki::Configure::FoswikiCfg::_parse($f1name, $root); 161 161 162 162 my $vo = $root->getValueObject('{One}'); … … 168 168 my ($f2, $f2name) = File::Temp::tempfile(unlink=>1); 169 169 print $f2 <<'EXAMPLE'; 170 $ TWiki::cfg{Two} = 'Two';170 $Foswiki::cfg{Two} = 'Two'; 171 171 # **BOOLEAN 10** 172 172 # Bad description 173 $ TWiki::cfg{One} = 'One';174 $ TWiki::cfg{Three} = 'Three';173 $Foswiki::cfg{One} = 'One'; 174 $Foswiki::cfg{Three} = 'Three'; 175 175 1; 176 176 EXAMPLE 177 177 $f2->close(); 178 TWiki::Configure::TWikiCfg::_parse($f2name, $root);178 Foswiki::Configure::FoswikiCfg::_parse($f2name, $root); 179 179 180 180 $vo = $root->getValueObject('{One}'); … … 198 198 $cfg{Two} = 'Two'; 199 199 $cfg{Three} = 'Three'; 200 my $valuer = new TWiki::Configure::Valuer(\%defaultCfg, \%cfg);201 my $root = new TWiki::Configure::Root();200 my $valuer = new Foswiki::Configure::Valuer(\%defaultCfg, \%cfg); 201 my $root = new Foswiki::Configure::Root(); 202 202 203 203 my ($f1, $f1name) = File::Temp::tempfile(unlink=>1); … … 214 214 EXAMPLE 215 215 $f1->close(); 216 TWiki::Configure::TWikiCfg::_parse($f1name, $root, 1);216 Foswiki::Configure::FoswikiCfg::_parse($f1name, $root, 1); 217 217 foreach my $k (keys %cfg) { 218 218 $defaultCfg{$k} = $cfg{$k}; … … 221 221 $cfg{Two} = 2; 222 222 $cfg{Three} = 3; 223 my $saver = new TWiki::Configure::TWikiCfg();223 my $saver = new Foswiki::Configure::FoswikiCfg(); 224 224 $saver->{valuer} = $valuer; 225 225 $saver->{root} = $root; … … 227 227 my $out = $saver->_save(); 228 228 my $expectorate = <<'SPUTUM'; 229 $ TWiki::cfg{One} = 1;230 $ TWiki::cfg{Two} = 2;231 $ TWiki::cfg{Three} = 3;229 $Foswiki::cfg{One} = 1; 230 $Foswiki::cfg{Two} = 2; 231 $Foswiki::cfg{Three} = 3; 232 232 1; 233 233 SPUTUM … … 237 237 sub test_UI { 238 238 my $this = shift; 239 my $root = new TWiki::Configure::Root();239 my $root = new Foswiki::Configure::Root(); 240 240 my %defaultCfg = (Value=>"before"); 241 241 my %cfg = (Value=>"after"); 242 my $valuer = new TWiki::Configure::Valuer(\%defaultCfg, \%cfg);243 244 my ($f1, $f1name) = File::Temp::tempfile(unlink=>1); 245 print $f1 <<'EXAMPLE'; 246 # **STRING 10** 247 $ TWiki::cfg{One} = 'One';248 # **STRING 10** 249 $ TWiki::cfg{Two} = 'Two';242 my $valuer = new Foswiki::Configure::Valuer(\%defaultCfg, \%cfg); 243 244 my ($f1, $f1name) = File::Temp::tempfile(unlink=>1); 245 print $f1 <<'EXAMPLE'; 246 # **STRING 10** 247 $Foswiki::cfg{One} = 'One'; 248 # **STRING 10** 249 $Foswiki::cfg{Two} = 'Two'; 250 250 # ---+ Plugins 251 251 # *PLUGINS* … … 253 253 EXAMPLE 254 254 $f1->close(); 255 TWiki::Configure::TWikiCfg::_parse($f1name, $root);255 Foswiki::Configure::FoswikiCfg::_parse($f1name, $root); 256 256 257 257 foreach my $k (keys %cfg) { … … 262 262 $defaultCfg{One} = "Eno"; 263 263 264 my $ui = TWiki::Configure::UI::loadUI('Root', $root);264 my $ui = Foswiki::Configure::UI::loadUI('Root', $root); 265 265 my $result = $ui->ui($root, $valuer); 266 266 # visual check … … 269 269 270 270 # print F '| ',gmtime(),' | ',$this->{user},' | ',$txt," |\n"; 271 # if( $ TWiki::cfg{ConfigurationLogName} &&272 # open(F, '>>'.$ TWiki::cfg{ConfigurationLogName} )) {271 # if( $Foswiki::cfg{ConfigurationLogName} && 272 # open(F, '>>'.$Foswiki::cfg{ConfigurationLogName} )) { 273 273 # print F '| ',gmtime(),' | ',$this->{user},' | ',$txt," |\n"; 274 274 # close(F); -
trunk/UnitTestContrib/test/unit/EmptyTests.pm
r14 r816 5 5 package EmptyTests; 6 6 7 use base qw( TWikiTestCase );7 use base qw( FoswikiTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 17 17 $this->SUPER::set_up(); 18 18 19 # You can now safely modify $ TWiki::cfg19 # You can now safely modify $Foswiki::cfg 20 20 21 21 $topicquery = new Unit::Request( '' ); 22 22 $topicquery->path_info( '/TestCases/WebHome' ); 23 23 try { 24 $this->{twiki} = new TWiki( 'AdminUser' || '' );24 $this->{twiki} = new Foswiki( 'AdminUser' || '' ); 25 25 my $user = $this->{twiki}->{user}; 26 26 … … 37 37 $user, 38 38 "Temporarytwikiweb", 39 " TWiki");39 "System"); 40 40 41 41 # Create a topic like this: … … 44 44 # to make sure you fixture protects things like .htpasswd 45 45 46 } catch TWiki::AccessControlException with {46 } catch Foswiki::AccessControlException with { 47 47 my $e = shift; 48 48 die "???" unless $e; -
trunk/UnitTestContrib/test/unit/ExampleTests.pm
r14 r816 4 4 package ExampleTests; 5 5 6 use base qw( TWikiTestCase);6 use base qw(FoswikiTestCase); 7 7 8 use TWiki;8 use Foswiki; 9 9 10 10 sub set_up { -
trunk/UnitTestContrib/test/unit/ExceptionTests.pm
r14 r816 1 1 package ExceptionTests; 2 use base TWikiTestCase;2 use base FoswikiTestCase; 3 3 4 4 use strict; 5 5 6 6 use Error qw( :try ); 7 use TWiki::OopsException;8 use TWiki::UI::Oops;7 use Foswiki::OopsException; 8 use Foswiki::UI::Oops; 9 9 10 10 # Check an OopsException with one non-array parameter … … 12 12 my $this = shift; 13 13 try { 14 throw TWiki::OopsException(14 throw Foswiki::OopsException( 15 15 'templatename', 16 16 web => 'webname', … … 19 19 keep => 1, 20 20 params => 'phlegm'); 21 } catch TWiki::OopsException with {21 } catch Foswiki::OopsException with { 22 22 my $e = shift; 23 $this->assert($e->isa(' TWiki::OopsException'));23 $this->assert($e->isa('Foswiki::OopsException')); 24 24 $this->assert_str_equals('webname', $e->{web}); 25 25 $this->assert_str_equals('topicname', $e->{topic}); … … 37 37 my $this = shift; 38 38 try { 39 throw TWiki::OopsException(39 throw Foswiki::OopsException( 40 40 'templatename', 41 41 web => 'webname', 42 42 topic => 'topicname', 43 43 params => [ 'phlegm', '<pus>' ]); 44 } catch TWiki::OopsException with {44 } catch Foswiki::OopsException with { 45 45 my $e = shift; 46 $this->assert($e->isa(' TWiki::OopsException'));46 $this->assert($e->isa('Foswiki::OopsException')); 47 47 $this->assert_str_equals('webname', $e->{web}); 48 48 $this->assert_str_equals('topicname', $e->{topic}); … … 56 56 sub upchuck { 57 57 my $session = shift; 58 my $e = new TWiki::OopsException(58 my $e = new Foswiki::OopsException( 59 59 'templatename', 60 60 web => 'webname', … … 66 66 sub test_redirectOopsException { 67 67 my $this = shift; 68 my $t = new TWiki();68 my $t = new Foswiki(); 69 69 my ($output, $result) = $this->capture(\&upchuck, $t); 70 70 $t->finish(); … … 75 75 sub test_AccessControlException { 76 76 my $this = shift; 77 my $ace = new TWiki::AccessControlException(77 my $ace = new Foswiki::AccessControlException( 78 78 'FRY', 79 79 'burger', … … 96 96 param4 => 'phlegm', 97 97 param5 => "the cat\nsat on\nthe rat"}); 98 my $session = new TWiki(undef, $query);99 my ($output, $result) = $this->capture(\& TWiki::UI::Oops::oops, $session,98 my $session = new Foswiki(undef, $query); 99 my ($output, $result) = $this->capture(\&Foswiki::UI::Oops::oops, $session, 100 100 "Flum", "DeDum", $query, 0); 101 101 $this->assert_matches(qr/^phlegm$/m, $output); -
trunk/UnitTestContrib/test/unit/Fn_GROUPS.pm
r664 r816 5 5 package Fn_GROUPS; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 32 32 | *Group* | *Members* | 33 33 | <nop>AdminGroup | [[TemporaryGROUPSUsersWeb.AdminUser][AdminUser]] [[TemporaryGROUPSUsersWeb.RegistrationAgent][RegistrationAgent]] | 34 | <nop> TWikiBaseGroup | [[TemporaryGROUPSUsersWeb.AdminUser][AdminUser]] [[TemporaryGROUPSUsersWeb.WikiGuest][WikiGuest]] [[TemporaryGROUPSUsersWeb.UnknownUser][UnknownUser]] [[TemporaryGROUPSUsersWeb.ProjectContributor][ProjectContributor]] [[TemporaryGROUPSUsersWeb.RegistrationAgent][RegistrationAgent]] |34 | <nop>BaseGroup | [[TemporaryGROUPSUsersWeb.AdminUser][AdminUser]] [[TemporaryGROUPSUsersWeb.WikiGuest][WikiGuest]] [[TemporaryGROUPSUsersWeb.UnknownUser][UnknownUser]] [[TemporaryGROUPSUsersWeb.ProjectContributor][ProjectContributor]] [[TemporaryGROUPSUsersWeb.RegistrationAgent][RegistrationAgent]] | 35 35 | [[TemporaryGROUPSUsersWeb.GropeGroup][GropeGroup]] | [[TemporaryGROUPSUsersWeb.ScumBag][ScumBag]] [[TemporaryGROUPSUsersWeb.WikiGuest][WikiGuest]] | 36 36 HUMPH -
trunk/UnitTestContrib/test/unit/Fn_IF.pm
r664 r816 5 5 package Fn_IF; 6 6 7 use base qw( TWikiFnTestCase );8 9 use TWiki;7 use base qw( FoswikiFnTestCase ); 8 9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 59 59 $this->simpleTest( 60 60 test => '$ WIKINAME = \'' 61 . TWiki::Func::getWikiName( $this->{twiki}->{user} ) . "'",61 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) . "'", 62 62 then => 1, 63 63 else => 0 … … 69 69 $this->simpleTest( 70 70 test => '$ \'WIKINAME\' = \'' 71 . TWiki::Func::getWikiName( $this->{twiki}->{user} ) . "'",71 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) . "'", 72 72 then => 1, 73 73 else => 0 … … 191 191 my $this = shift; 192 192 $this->simpleTest( 193 test => "\$PUBURLPATH='" . $ TWiki::cfg{PubUrlPath} . "'",193 test => "\$PUBURLPATH='" . $Foswiki::cfg{PubUrlPath} . "'", 194 194 then => 1, 195 195 else => 0 … … 200 200 my $this = shift; 201 201 $this->simpleTest( 202 test => "\$'PUBURLPATH'='" . $ TWiki::cfg{PubUrlPath} . "'",202 test => "\$'PUBURLPATH'='" . $Foswiki::cfg{PubUrlPath} . "'", 203 203 then => 1, 204 204 else => 0 … … 235 235 $this->simpleTest( 236 236 test => "d2n('2007-03-26')=" 237 . TWiki::Time::parseTime( '2007-03-26', 1 ),237 . Foswiki::Time::parseTime( '2007-03-26', 1 ), 238 238 then => 1, 239 239 else => 0 … … 280 280 $this->simpleTest( 281 281 test => "'" 282 . TWiki::Func::getWikiName( $this->{twiki}->{user} )282 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 283 283 . "' ingroup 'WikiGuest'", 284 284 then => 0, … … 291 291 $this->simpleTest( 292 292 test => "'" 293 . TWiki::Func::wikiToUserName(294 TWiki::Func::getWikiName( $this->{twiki}->{user} )293 . Foswiki::Func::wikiToUserName( 294 Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 295 295 ) 296 296 . "' ingroup 'WikiGuest'", … … 314 314 $this->simpleTest( 315 315 test => "'" 316 . TWiki::Func::getWikiName( $this->{twiki}->{user} )316 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 317 317 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 318 318 then => 0, … … 325 325 $this->simpleTest( 326 326 test => "'" 327 . TWiki::Func::wikiToUserName(328 TWiki::Func::getWikiName( $this->{twiki}->{user} )327 . Foswiki::Func::wikiToUserName( 328 Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 329 329 ) 330 330 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", … … 350 350 $this->simpleTest( 351 351 test => "'" 352 . TWiki::Func::wikiToUserName(353 TWiki::Func::getWikiName( $this->{twiki}->{user} )352 . Foswiki::Func::wikiToUserName( 353 Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 354 354 ) 355 . "' ingroup '$ TWiki::cfg{SuperAdminGroup}'",355 . "' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 356 356 then => 0, 357 357 else => 1 … … 363 363 $this->simpleTest( 364 364 test => "'" 365 . TWiki::Func::getWikiName( $this->{twiki}->{user} )366 . "' ingroup '$ TWiki::cfg{SuperAdminGroup}'",365 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 366 . "' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 367 367 then => 0, 368 368 else => 1 … … 375 375 test => "'" 376 376 . $this->{twiki}->{user} 377 . "' ingroup '$ TWiki::cfg{SuperAdminGroup}'",377 . "' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 378 378 then => 0, 379 379 else => 1 … … 386 386 $this->simpleTest( 387 387 test => "'" 388 . TWiki::Func::wikiToUserName(389 TWiki::Func::getWikiName( $this->{twiki}->{user} )388 . Foswiki::Func::wikiToUserName( 389 Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 390 390 ) 391 391 . "' ingroup 'GropeGroup'", … … 399 399 $this->simpleTest( 400 400 test => "'" 401 . TWiki::Func::getWikiName( $this->{twiki}->{user} )401 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 402 402 . "' ingroup 'GropeGroup'", 403 403 then => 1, … … 439 439 my $this = shift; 440 440 $this->simpleTest( 441 test => "'%USERNAME%' ingroup '$ TWiki::cfg{SuperAdminGroup}'",441 test => "'%USERNAME%' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 442 442 then => 0, 443 443 else => 1 … … 477 477 $this->simpleTest( 478 478 test => "'%USERINFO{format=\"\$username\"}%' ingroup '" 479 . $ TWiki::cfg{SuperAdminGroup} . "'",479 . $Foswiki::cfg{SuperAdminGroup} . "'", 480 480 then => 0, 481 481 else => 1 … … 515 515 $this->simpleTest( 516 516 test => "'%USERINFO{format=\"\$wikiname\"}%' ingroup '" 517 . $ TWiki::cfg{SuperAdminGroup} . "'",517 . $Foswiki::cfg{SuperAdminGroup} . "'", 518 518 then => 0, 519 519 else => 1 … … 553 553 $this->simpleTest( 554 554 test => "'%USERINFO{format=\"\$wikiusername\"}%' ingroup '" 555 . $ TWiki::cfg{SuperAdminGroup} . "'",555 . $Foswiki::cfg{SuperAdminGroup} . "'", 556 556 then => 0, 557 557 else => 1 … … 572 572 $this->simpleTest( 573 573 test => "'" 574 . TWiki::Func::getWikiName( $this->{twiki}->{user} )574 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 575 575 . "' ingroup 'WikiGuest'", 576 576 then => 0, … … 583 583 $this->simpleTest( 584 584 test => "'" 585 . TWiki::Func::getWikiName( $this->{twiki}->{user} )585 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 586 586 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 587 587 then => 0, … … 594 594 $this->simpleTest( 595 595 test => "'" 596 . TWiki::Func::getWikiName( $this->{twiki}->{user} )596 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 597 597 . "' ingroup '" 598 . $ TWiki::cfg{SuperAdminGroup} . "'",598 . $Foswiki::cfg{SuperAdminGroup} . "'", 599 599 then => 0, 600 600 else => 1 … … 606 606 $this->simpleTest( 607 607 test => "'" 608 . TWiki::Func::getWikiName( $this->{twiki}->{user} )608 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 609 609 . "' ingroup 'GropeGroup'", 610 610 then => 1, … … 616 616 my $this = shift; 617 617 $this->simpleTest( 618 test => "'" . $ TWiki::cfg{AdminUserWikiName} . "' ingroup 'WikiGuest'",618 test => "'" . $Foswiki::cfg{AdminUserWikiName} . "' ingroup 'WikiGuest'", 619 619 then => 0, 620 620 else => 1 … … 626 626 $this->simpleTest( 627 627 test => "'" 628 . $ TWiki::cfg{AdminUserWikiName}628 . $Foswiki::cfg{AdminUserWikiName} 629 629 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 630 630 then => 0, … … 637 637 $this->simpleTest( 638 638 test => "'" 639 . $ TWiki::cfg{AdminUserWikiName}639 . $Foswiki::cfg{AdminUserWikiName} 640 640 . "' ingroup '" 641 . $ TWiki::cfg{SuperAdminGroup} . "'",641 . $Foswiki::cfg{SuperAdminGroup} . "'", 642 642 then => 1, 643 643 else => 0 … … 648 648 my $this = shift; 649 649 $this->simpleTest( 650 test => "'" . $ TWiki::cfg{AdminUserWikiName} . "' ingroup 'GropeGroup'",650 test => "'" . $Foswiki::cfg{AdminUserWikiName} . "' ingroup 'GropeGroup'", 651 651 then => 0, 652 652 else => 1 … … 658 658 $this->simpleTest( 659 659 test => "'" 660 . $ TWiki::cfg{DefaultUserWikiName}660 . $Foswiki::cfg{DefaultUserWikiName} 661 661 . "' ingroup 'WikiGuest'", 662 662 then => 0, … … 669 669 $this->simpleTest( 670 670 test => "'" 671 . $ TWiki::cfg{DefaultUserWikiName}671 . $Foswiki::cfg{DefaultUserWikiName} 672 672 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 673 673 then => 0, … … 680 680 $this->simpleTest( 681 681 test => "'" 682 . $ TWiki::cfg{DefaultUserWikiName}682 . $Foswiki::cfg{DefaultUserWikiName} 683 683 . "' ingroup '" 684 . $ TWiki::cfg{SuperAdminGroup} . "'",684 . $Foswiki::cfg{SuperAdminGroup} . "'", 685 685 then => 0, 686 686 else => 1 … … 691 691 my $this = shift; 692 692 $this->simpleTest( 693 test => "'$ TWiki::cfg{DefaultUserWikiName}' ingroup 'GropeGroup'",693 test => "'$Foswiki::cfg{DefaultUserWikiName}' ingroup 'GropeGroup'", 694 694 then => 1, 695 695 else => 0 … … 700 700 my $this = shift; 701 701 $this->simpleTest( 702 test => "'" . $ TWiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'",702 test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'", 703 703 then => 0, 704 704 else => 1 … … 710 710 $this->simpleTest( 711 711 test => "'" 712 . $ TWiki::cfg{AdminUserLogin}712 . $Foswiki::cfg{AdminUserLogin} 713 713 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 714 714 then => 0, … … 721 721 $this->simpleTest( 722 722 test => "'" 723 . $ TWiki::cfg{AdminUserLogin}723 . $Foswiki::cfg{AdminUserLogin} 724 724 . "' ingroup '" 725 . $ TWiki::cfg{SuperAdminGroup} . "'",725 . $Foswiki::cfg{SuperAdminGroup} . "'", 726 726 then => 1, 727 727 else => 0 … … 732 732 my $this = shift; 733 733 $this->simpleTest( 734 test => "'" . $ TWiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'",734 test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'", 735 735 then => 0, 736 736 else => 1 … … 741 741 my $this = shift; 742 742 $this->simpleTest( 743 test => "'" . $ TWiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'",743 test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'", 744 744 then => 0, 745 745 else => 1 … … 751 751 $this->simpleTest( 752 752 test => "'" 753 . $ TWiki::cfg{DefaultUserLogin}753 . $Foswiki::cfg{DefaultUserLogin} 754 754 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 755 755 then => 0, … … 762 762 $this->simpleTest( 763 763 test => "'" 764 . $ TWiki::cfg{DefaultUserLogin}764 . $Foswiki::cfg{DefaultUserLogin} 765 765 . "' ingroup '" 766 . $ TWiki::cfg{SuperAdminGroup} . "'",766 . $Foswiki::cfg{SuperAdminGroup} . "'", 767 767 then => 0, 768 768 else => 1 … … 773 773 my $this = shift; 774 774 $this->simpleTest( 775 test => "'" . $ TWiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'",775 test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'", 776 776 then => 1, 777 777 else => 0 … … 782 782 my $this = shift; 783 783 $this->simpleTest( 784 test => "'" . $ TWiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'",784 test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'", 785 785 then => 0, 786 786 else => 1 … … 792 792 $this->simpleTest( 793 793 test => "'" 794 . $ TWiki::cfg{AdminUserLogin}794 . $Foswiki::cfg{AdminUserLogin} 795 795 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 796 796 then => 0, … … 803 803 $this->simpleTest( 804 804 test => "'" 805 . $ TWiki::cfg{AdminUserLogin}805 . $Foswiki::cfg{AdminUserLogin} 806 806 . "' ingroup '" 807 . $ TWiki::cfg{SuperAdminGroup} . "'",807 . $Foswiki::cfg{SuperAdminGroup} . "'", 808 808 then => 1, 809 809 else => 0 … … 814 814 my $this = shift; 815 815 $this->simpleTest( 816 test => "'" . $ TWiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'",816 test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'", 817 817 then => 0, 818 818 else => 1 … … 823 823 my $this = shift; 824 824 $this->simpleTest( 825 test => "'" . $ TWiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'",825 test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'", 826 826 then => 0, 827 827 else => 1 … … 833 833 $this->simpleTest( 834 834 test => "'" 835 . $ TWiki::cfg{DefaultUserLogin}835 . $Foswiki::cfg{DefaultUserLogin} 836 836 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 837 837 then => 0, … … 844 844 $this->simpleTest( 845 845 test => "'" 846 . $ TWiki::cfg{DefaultUserLogin}846 . $Foswiki::cfg{DefaultUserLogin} 847 847 . "' ingroup '" 848 . $ TWiki::cfg{SuperAdminGroup} . "'",848 . $Foswiki::cfg{SuperAdminGroup} . "'", 849 849 then => 0, 850 850 else => 1 … … 855 855 my $this = shift; 856 856 $this->simpleTest( 857 test => "'" . $ TWiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'",857 test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'", 858 858 then => 1, 859 859 else => 0 … … 863 863 sub test_90 { 864 864 my $this = shift; 865 $this->simpleTest( test => "isweb ' TWiki'", then => 1, else => 0 );865 $this->simpleTest( test => "isweb 'System'", then => 1, else => 0 ); 866 866 } 867 867 … … 873 873 sub test_92 { 874 874 my $this = shift; 875 $this->simpleTest( test => "istopic \$' TWiki'", then => 0, else => 1 );875 $this->simpleTest( test => "istopic \$'System'", then => 0, else => 1 ); 876 876 } 877 877 … … 935 935 "GropeGroup", 936 936 " * Set GROUP = " 937 . TWiki::Func::getWikiName( $this->{twiki}->{user} ) . "\n"937 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) . "\n" 938 938 ); 939 939 … … 951 951 my ( $this, %test ) = @_; 952 952 $this->{twiki}->enterContext('test'); 953 $ TWiki::cfg{Fnargle} = 'Fleeble';954 $ TWiki::cfg{A}{B} = 'C';953 $Foswiki::cfg{Fnargle} = 'Fleeble'; 954 $Foswiki::cfg{A}{B} = 'C'; 955 955 $this->{request}->param('notempty','v'); 956 956 $this->{request}->param('empty',''); … … 963 963 964 964 my $meta = 965 new TWiki::Meta( $this->{twiki}, $this->{test_web}, $this->{test_topic} );965 new Foswiki::Meta( $this->{twiki}, $this->{test_web}, $this->{test_topic} ); 966 966 my $text = '%IF{"' 967 967 . $test{test} … … 1038 1038 sub test_ALLOWS_and_EXISTS { 1039 1039 my $this = shift; 1040 my $wn = TWiki::Func::getWikiName( $this->{twiki}->{user} );1040 my $wn = Foswiki::Func::getWikiName( $this->{twiki}->{user} ); 1041 1041 $this->{twiki}->{store} 1042 1042 ->saveTopic( $this->{twiki}->{user}, $this->{test_web}, "DeadDog", … … 1184 1184 1185 1185 $this->{twiki}->finish(); 1186 $this->{twiki} = new TWiki();1186 $this->{twiki} = new Foswiki(); 1187 1187 $this->{twiki}->{webName} = $this->{test_web}; # hack 1188 1188 … … 1231 1231 $this->{twiki}->{store}->topicExists( $this->{test_web}, $topicName ) ); 1232 1232 1233 #TODO: these need to be moved into Fn_META and then implemented (its a really simple change in TWiki.pm1233 #TODO: these need to be moved into Fn_META and then implemented (its a really simple change in Foswiki.pm 1234 1234 # $this->assert_str_equals( 1235 1235 # $this->{twiki}->handleCommonTags( -
trunk/UnitTestContrib/test/unit/Fn_INCLUDE.pm
r766 r816 5 5 package Fn_INCLUDE; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 55 55 7 ($includedTopic) 56 56 8 #$includedTopic 57 9 [[ system.$includedTopic]]57 9 [[System.$includedTopic]] 58 58 10 [[$includedTopic]] 59 59 11 [[http://fleegle][$includedTopic]] … … 81 81 7 ($this->{other_web}.$includedTopic) 82 82 8 #$includedTopic 83 9 [[ system.$includedTopic]]83 9 [[System.$includedTopic]] 84 84 10 [[$this->{other_web}.$includedTopic][$includedTopic]] 85 85 11 [[http://fleegle][$includedTopic]] -
trunk/UnitTestContrib/test/unit/Fn_NOP.pm
r14 r816 5 5 package Fn_NOP; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 -
trunk/UnitTestContrib/test/unit/Fn_REVINFO.pm
r666 r816 4 4 5 5 package Fn_REVINFO; 6 use base qw( TWikiFnTestCase );6 use base qw( FoswikiFnTestCase ); 7 7 8 8 use strict; 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 12 12 sub new { 13 $ TWiki::cfg{Register}{AllowLoginName} = 1;13 $Foswiki::cfg{Register}{AllowLoginName} = 1; 14 14 my $self = shift()->SUPER::new('REVINFO', @_); 15 15 return $self; … … 33 33 my $ui = $this->{twiki}->handleCommonTags( 34 34 '%REVINFO%', $this->{test_web}, $this->{test_topic}); 35 my $guest = TWiki::Func::getWikiName();35 my $guest = Foswiki::Func::getWikiName(); 36 36 unless ($ui =~ /^r1 - \d+ \w+ \d+ - \d+:\d+:\d+ - $this->{users_web}\.$guest$/) { 37 37 $this->assert(0, $ui); … … 126 126 # This test is specific to the "traditional" text database implementation, 127 127 # either RcsWrap or RcsLite. 128 if ($ TWiki::cfg{StoreImpl} ne 'RcsLite' &&129 $ TWiki::cfg{StoreImpl} ne 'RcsWrap') {128 if ($Foswiki::cfg{StoreImpl} ne 'RcsLite' && 129 $Foswiki::cfg{StoreImpl} ne 'RcsWrap') { 130 130 return; 131 131 } 132 132 $this->assert(open( 133 F, '>', "$ TWiki::cfg{DataDir}/$this->{test_web}/CrikeyMoses.txt"));133 F, '>', "$Foswiki::cfg{DataDir}/$this->{test_web}/CrikeyMoses.txt")); 134 134 print F <<'HERE'; 135 135 %META:TOPICINFO{author="ScumBag" date="1120846368" format="1.1" version="$Rev: 16686 $"}% … … 149 149 # This test is specific to the "traditional" text database implementation, 150 150 # either RcsWrap or RcsLite. 151 if ($ TWiki::cfg{StoreImpl} ne 'RcsLite' &&152 $ TWiki::cfg{StoreImpl} ne 'RcsWrap') {151 if ($Foswiki::cfg{StoreImpl} ne 'RcsLite' && 152 $Foswiki::cfg{StoreImpl} ne 'RcsWrap') { 153 153 return; 154 154 } 155 155 $this->assert(open( 156 F, '>', "$ TWiki::cfg{DataDir}/$this->{test_web}/CrikeyMoses.txt"));156 F, '>', "$Foswiki::cfg{DataDir}/$this->{test_web}/CrikeyMoses.txt")); 157 157 print F <<'HERE'; 158 158 %META:TOPICINFO{author="scum" date="1120846368" format="1.1" version="$Rev: 16686 $"}% … … 172 172 # This test is specific to the "traditional" text database implementation, 173 173 # either RcsWrap or RcsLite. 174 if ($ TWiki::cfg{StoreImpl} ne 'RcsLite' &&175 $ TWiki::cfg{StoreImpl} ne 'RcsWrap') {174 if ($Foswiki::cfg{StoreImpl} ne 'RcsLite' && 175 $Foswiki::cfg{StoreImpl} ne 'RcsWrap') { 176 176 return; 177 177 } 178 178 $this->assert(open( 179 F, '>', "$ TWiki::cfg{DataDir}/$this->{test_web}/GeeWillikins.txt"));179 F, '>', "$Foswiki::cfg{DataDir}/$this->{test_web}/GeeWillikins.txt")); 180 180 print F <<'HERE'; 181 181 %META:TOPICINFO{author="eltonjohn" date="1120846368" format="1.1" version="$Rev: 16686 $"}% 182 182 HERE 183 183 close(F); 184 $ TWiki::cfg{RenderLoggedInButUnknownUsers} = 0;184 $Foswiki::cfg{RenderLoggedInButUnknownUsers} = 0; 185 185 my $ui = $this->{twiki}->handleCommonTags( 186 186 '%REVINFO{format="$username $wikiname $wikiusername"}%', 187 187 $this->{test_web}, 'GeeWillikins'); 188 188 $this->assert_str_equals("eltonjohn eltonjohn eltonjohn", $ui); 189 $ TWiki::cfg{RenderLoggedInButUnknownUsers} = 1;189 $Foswiki::cfg{RenderLoggedInButUnknownUsers} = 1; 190 190 $ui = $this->{twiki}->handleCommonTags( 191 191 '%REVINFO{format="$username $wikiname $wikiusername"}%', -
trunk/UnitTestContrib/test/unit/Fn_SCRIPTURL.pm
r14 r816 5 5 package Fn_SCRIPTURL; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 18 18 my $this = shift; 19 19 20 $ TWiki::cfg{ScriptUrlPaths}{snarf} = "sausages";21 undef $ TWiki::cfg{ScriptUrlPaths}{view};22 $ TWiki::cfg{ScriptSuffix} = ".dot";20 $Foswiki::cfg{ScriptUrlPaths}{snarf} = "sausages"; 21 undef $Foswiki::cfg{ScriptUrlPaths}{view}; 22 $Foswiki::cfg{ScriptSuffix} = ".dot"; 23 23 24 24 my $result = $this->{twiki}->handleCommonTags("%SCRIPTURL%", $this->{test_web}, $this->{test_topic}); 25 25 $this->assert_str_equals( 26 "$ TWiki::cfg{DefaultUrlHost}$TWiki::cfg{ScriptUrlPath}", $result);26 "$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{ScriptUrlPath}", $result); 27 27 28 28 $result = $this->{twiki}->handleCommonTags( 29 29 "%SCRIPTURLPATH{view}%", $this->{test_web}, $this->{test_topic}); 30 $this->assert_str_equals("$ TWiki::cfg{ScriptUrlPath}/view.dot", $result);30 $this->assert_str_equals("$Foswiki::cfg{ScriptUrlPath}/view.dot", $result); 31 31 32 32 $result = $this->{twiki}->handleCommonTags( -
trunk/UnitTestContrib/test/unit/Fn_SEARCH.pm
r649 r816 6 6 package Fn_SEARCH; 7 7 8 use base qw( TWikiFnTestCase );9 10 use TWiki;8 use base qw( FoswikiFnTestCase ); 9 10 use Foswiki; 11 11 use Error qw( :try ); 12 12 … … 36 36 my (%salgs, %qalgs); 37 37 foreach my $dir (@INC) { 38 if (opendir(D, "$dir/ TWiki/Store/SearchAlgorithms")) {38 if (opendir(D, "$dir/Foswiki/Store/SearchAlgorithms")) { 39 39 foreach my $alg (readdir D) { 40 40 next unless $alg =~ /^(.*)\.pm$/; … … 44 44 closedir(D); 45 45 } 46 if (opendir(D, "$dir/ TWiki/Store/QueryAlgorithms")) {46 if (opendir(D, "$dir/Foswiki/Store/QueryAlgorithms")) { 47 47 foreach my $alg (readdir D) { 48 48 next unless $alg =~ /^(.*)\.pm$/; … … 60 60 eval <<SUB; 61 61 sub $fn { 62 require TWiki::Store::SearchAlgorithms::$alg;63 \$ TWiki::cfg{RCS}{SearchAlgorithm} = 'TWiki::Store::SearchAlgorithms::$alg'; }62 require Foswiki::Store::SearchAlgorithms::$alg; 63 \$Foswiki::cfg{RCS}{SearchAlgorithm} = 'Foswiki::Store::SearchAlgorithms::$alg'; } 64 64 SUB 65 65 die $@ if $@; … … 71 71 eval <<SUB; 72 72 sub $fn { 73 require TWiki::Store::QueryAlgorithms::$alg;74 \$ TWiki::cfg{RCS}{QueryAlgorithm} = 'TWiki::Store::QueryAlgorithms::$alg'; }73 require Foswiki::Store::QueryAlgorithms::$alg; 74 \$Foswiki::cfg{RCS}{QueryAlgorithm} = 'Foswiki::Store::QueryAlgorithms::$alg'; } 75 75 SUB 76 76 die $@ if $@; … … 611 611 $query->path_info("/$this->{test_web}/$this->{test_topic}"); 612 612 613 $this->{twiki} = new TWiki(undef, $query);613 $this->{twiki} = new Foswiki(undef, $query); 614 614 $this->assert_str_equals($this->{test_web}, $this->{twiki}->{webName}); 615 $ TWiki::Plugins::SESSION = $this->{twiki};615 $Foswiki::Plugins::SESSION = $this->{twiki}; 616 616 } 617 617 -
trunk/UnitTestContrib/test/unit/Fn_SECTION.pm
r14 r816 5 5 package Fn_SECTION; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 25 25 # Named section closed without being opened 26 26 my $text = '0%ENDSECTION{"name"}%1'; 27 my( $nt, $s ) = TWiki::parseSections( $text );27 my( $nt, $s ) = Foswiki::parseSections( $text ); 28 28 $this->assert_str_equals("01",$nt); 29 29 $this->assert_str_equals('',dumpsec($s)); … … 35 35 # Named section opened but never closed 36 36 my $text = '0%STARTSECTION{"name"}%1'; 37 my ( $nt, $s ) = TWiki::parseSections( $text );37 my ( $nt, $s ) = Foswiki::parseSections( $text ); 38 38 $this->assert_str_equals("01",$nt); 39 39 $this->assert_str_equals('end="2" name="name" start="1" type="section"',dumpsec($s)); … … 45 45 # Unnamed section closed without being opened 46 46 my $text = '0%ENDSECTION%1'; 47 my ( $nt, $s ) = TWiki::parseSections( $text );47 my ( $nt, $s ) = Foswiki::parseSections( $text ); 48 48 $this->assert_str_equals("01",$nt); 49 49 $this->assert_str_equals('',dumpsec($s)); … … 55 55 # Unnamed section opened but never closed 56 56 my $text = '0%STARTSECTION%1'; 57 my ( $nt, $s ) = TWiki::parseSections( $text );57 my ( $nt, $s ) = Foswiki::parseSections( $text ); 58 58 $this->assert_str_equals("01",$nt); 59 59 $this->assert_str_equals('end="2" name="_SECTION0" start="1" type="section"',dumpsec($s)); … … 65 65 # Unnamed section closed by opening another section of the same type 66 66 my $text = '0%STARTSECTION%1%STARTSECTION%2'; 67 my ( $nt, $s ) = TWiki::parseSections( $text );67 my ( $nt, $s ) = Foswiki::parseSections( $text ); 68 68 $this->assert_str_equals("012",$nt); 69 69 $this->assert_str_equals('end="2" name="_SECTION0" start="1" type="section";end="3" name="_SECTION1" start="2" type="section"',dumpsec($s)); … … 75 75 # Named section overlaps unnamed section before it 76 76 my $text = '0%STARTSECTION%1%STARTSECTION{"named"}%2%ENDSECTION%3%ENDSECTION{"named"}%4'; 77 my ( $nt, $s ) = TWiki::parseSections( $text );77 my ( $nt, $s ) = Foswiki::parseSections( $text ); 78 78 $this->assert_str_equals("01234",$nt); 79 79 $this->assert_str_equals('end="2" name="_SECTION0" start="1" type="section";end="4" name="named" start="2" type="section"',dumpsec($s)); … … 85 85 # Named section overlaps unnamed section after it 86 86 my $text = '0%STARTSECTION{"named"}%1%STARTSECTION%2%ENDSECTION{"named"}%3%ENDSECTION%4'; 87 my ( $nt, $s ) = TWiki::parseSections( $text );87 my ( $nt, $s ) = Foswiki::parseSections( $text ); 88 88 $this->assert_str_equals("01234",$nt); 89 89 $this->assert_str_equals('end="3" name="named" start="1" type="section";end="4" name="_SECTION0" start="2" type="section"',dumpsec($s)); … … 95 95 # Unnamed sections of different types overlap 96 96 my $text = '0%STARTSECTION{type="include"}%1%STARTSECTION{type="templateonly"}%2%ENDSECTION{type="include"}%3%ENDSECTION{type="templateonly"}%4'; 97 my ( $nt, $s ) = TWiki::parseSections( $text );97 my ( $nt, $s ) = Foswiki::parseSections( $text ); 98 98 $this->assert_str_equals("01234",$nt); 99 99 $this->assert_str_equals('end="3" name="_SECTION0" start="1" type="include";end="4" name="_SECTION1" start="2" type="templateonly"',dumpsec($s)); … … 105 105 # Named sections of same type overlap 106 106 my $text = '0%STARTSECTION{"one"}%1%STARTSECTION{"two"}%2%ENDSECTION{"one"}%3%ENDSECTION{"two"}%4'; 107 my ( $nt, $s ) = TWiki::parseSections( $text );107 my ( $nt, $s ) = Foswiki::parseSections( $text ); 108 108 $this->assert_str_equals("01234",$nt); 109 109 $this->assert_str_equals('end="3" name="one" start="1" type="section";end="4" name="two" start="2" type="section"',dumpsec($s)); … … 115 115 # Named sections nested 116 116 my $text = '0%STARTSECTION{name="one"}%1%STARTSECTION{name="two"}%2%ENDSECTION{name="two"}%3%ENDSECTION{name="one"}%4'; 117 my ( $nt, $s ) = TWiki::parseSections( $text );117 my ( $nt, $s ) = Foswiki::parseSections( $text ); 118 118 $this->assert_str_equals("01234",$nt); 119 119 $this->assert_str_equals('end="4" name="one" start="1" type="section";end="3" name="two" start="2" type="section"',dumpsec($s)); -
trunk/UnitTestContrib/test/unit/Fn_SEP.pm
r14 r816 5 5 package Fn_SEP; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 -
trunk/UnitTestContrib/test/unit/Fn_URLPARAM.pm
r14 r816 4 4 # 5 5 package Fn_URLPARAM; 6 use base qw( TWikiFnTestCase );6 use base qw( FoswikiFnTestCase ); 7 7 8 8 use strict; -
trunk/UnitTestContrib/test/unit/Fn_USERINFO.pm
r664 r816 5 5 package Fn_USERINFO; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 12 12 sub new { 13 $ TWiki::cfg{Register}{AllowLoginName} = 1;13 $Foswiki::cfg{Register}{AllowLoginName} = 1; 14 14 my $self = shift()->SUPER::new('USERINFO', @_); 15 15 return $self; … … 28 28 my $this = shift; 29 29 30 $ TWiki::cfg{AntiSpam}{HideUserDetails} = 0;30 $Foswiki::cfg{AntiSpam}{HideUserDetails} = 0; 31 31 my $ui = $this->{twiki}->handleCommonTags( 32 32 '%USERINFO%', $this->{test_web}, $this->{test_topic}); 33 33 $this->assert_str_equals( 34 $ TWiki::cfg{DefaultUserLogin}.", $TWiki::cfg{UsersWebName}.".$TWiki::cfg{DefaultUserWikiName}.", ", $ui);34 $Foswiki::cfg{DefaultUserLogin}.", $Foswiki::cfg{UsersWebName}.".$Foswiki::cfg{DefaultUserWikiName}.", ", $ui); 35 35 } 36 36 … … 38 38 my $this = shift; 39 39 40 $ TWiki::cfg{AntiSpam}{HideUserDetails} = 0;40 $Foswiki::cfg{AntiSpam}{HideUserDetails} = 0; 41 41 my $ui = $this->{twiki}->handleCommonTags('%USERINFO{"ScumBag"}%', $this->{test_web}, $this->{test_topic}); 42 42 $this->assert_str_equals( 43 "scum, $ TWiki::cfg{UsersWebName}.ScumBag, scumbag\@example.com", $ui);43 "scum, $Foswiki::cfg{UsersWebName}.ScumBag, scumbag\@example.com", $ui); 44 44 } 45 45 … … 47 47 my $this = shift; 48 48 49 $ TWiki::cfg{AntiSpam}{HideUserDetails} = 0;49 $Foswiki::cfg{AntiSpam}{HideUserDetails} = 0; 50 50 my $ui = $this->{twiki}->handleCommonTags('%USERINFO{"scum"}%', $this->{test_web}, $this->{test_topic}); 51 51 $this->assert_str_equals( 52 "scum, $ TWiki::cfg{UsersWebName}.ScumBag, scumbag\@example.com", $ui);52 "scum, $Foswiki::cfg{UsersWebName}.ScumBag, scumbag\@example.com", $ui); 53 53 } 54 54 … … 56 56 my $this = shift; 57 57 58 $ TWiki::cfg{AntiSpam}{HideUserDetails} = 0;58 $Foswiki::cfg{AntiSpam}{HideUserDetails} = 0; 59 59 my $ui = $this->{twiki}->handleCommonTags('%USERINFO{"ScumBag" format="W$wikiusernameU$wikinameE$emailsG$groupsE"}%', $this->{test_web}, $this->{test_topic}); 60 60 $this->assert_str_equals( 61 "W$ TWiki::cfg{UsersWebName}.ScumBagUScumBagEscumbag\@example.comGGropeGroupE", $ui);61 "W$Foswiki::cfg{UsersWebName}.ScumBagUScumBagEscumbag\@example.comGGropeGroupE", $ui); 62 62 63 63 my $guest_ui = $this->{twiki}->handleCommonTags('%USERINFO{"WikiGuest" format="W$wikiusernameU$wikinameE$emailsG$groupsE"}%', $this->{test_web}, $this->{test_topic}); 64 64 $this->assert_str_equals( 65 "WTemporaryUSERINFOUsersWeb.WikiGuestUWikiGuestEG TWikiBaseGroup, GropeGroupE", $guest_ui);65 "WTemporaryUSERINFOUsersWeb.WikiGuestUWikiGuestEGBaseGroup, GropeGroupE", $guest_ui); 66 66 } 67 67 -
trunk/UnitTestContrib/test/unit/Fn_VAR.pm
r14 r816 5 5 package Fn_VAR; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 32 32 33 33 $this->{twiki}->finish(); 34 $this->{twiki} = new TWiki();34 $this->{twiki} = new Foswiki(); 35 35 36 36 $result = $this->{twiki}->handleCommonTags("%VAR{\"VAR\"}%", $this->{test_web}, $this->{test_topic}); -
trunk/UnitTestContrib/test/unit/FormDefTests.pm
r412 r816 3 3 package FormDefTests; 4 4 5 use base qw( TWikiFnTestCase);5 use base qw(FoswikiFnTestCase); 6 6 7 use TWiki;8 use TWiki::Form;7 use Foswiki; 8 use Foswiki::Form; 9 9 use strict; 10 10 use Assert; … … 19 19 | Date | date | 30 | 20 20 FORM 21 my $def = TWiki::Form->new($this->{twiki}, $this->{test_web}, 'TestForm');21 my $def = Foswiki::Form->new($this->{twiki}, $this->{test_web}, 'TestForm'); 22 22 23 23 $this->assert_equals(1, scalar @{$def->getFields()}); … … 42 42 | Checky Egg | checkbox | 1 | 1,2,3,4 | Blip | | 43 43 FORM 44 my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm');44 my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 45 45 46 46 $this->assert_equals(2, scalar @{$def->getFields()}); … … 82 82 | Age | 83 83 FORM 84 my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm');84 my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 85 85 86 86 $this->assert_equals(1, scalar @{$def->getFields()}); … … 111 111 | Age | 112 112 FORM 113 my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm');113 my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 114 114 115 115 $this->assert_equals(1, scalar @{$def->getFields()}); … … 139 139 | Beauty | 140 140 FORM 141 my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm');141 my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 142 142 143 143 $this->assert_equals(1, scalar @{$def->getFields()}); … … 164 164 FORM 165 165 166 my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm');166 my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 167 167 168 168 my $f = $def->getField('Ecks'); … … 186 186 $this->{twiki}->{store}->readTopic( 187 187 undef, $this->{test_web}, 'SplodgeOne'); 188 my $form = new TWiki::Form(188 my $form = new Foswiki::Form( 189 189 $this->{twiki}, $this->{test_web}, 'NonExistantForm', $meta); 190 190 my $f = $form->getField('Ecks'); -
trunk/UnitTestContrib/test/unit/FormattingTests.pm
