Changeset 816


Ignore:
Timestamp:
11/19/08 19:11:33 (3 years ago)
Author:
CrawfordCurrie
Message:

Item175: ported unit tests to new namespace. They all pass.

Location:
trunk
Files:
63 edited
6 moved

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/ 
    22# 
    33# This program is free software; you can redistribute it and/or 
     
    1212# http://www.gnu.org/copyleft/gpl.html 
    1313 
    14 package TWiki::Contrib::UnitTestContrib; 
     14package Foswiki::Contrib::UnitTestContrib; 
    1515 
    1616use strict; 
  • trunk/UnitTestContrib/lib/Foswiki/Contrib/UnitTestContrib/MANIFEST

    r15 r816  
    1 lib/TWiki/Contrib/UnitTestContrib.pm 0644 
    2 lib/TWiki/UI/Test.pm 0644 
     1lib/Foswiki/Contrib/UnitTestContrib.pm 0644 
     2lib/Foswiki/UI/Test.pm 0644 
    33lib/Unit/Eavesdrop.pm 0644 
    44lib/Unit/HTMLDiffer.pm 0644 
     
    5555test/unit/StoreTests.pm 0644 
    5656test/unit/TOCTests.pm 0644 
    57 test/unit/TWikiFnTestCase.pm 0644 
    58 test/unit/TWikiSuite.pm 0644 
    59 test/unit/TWikiTestCase.pm 0644 
     57test/unit/FoswikiFnTestCase.pm 0644 
     58test/unit/FoswikiSuite.pm 0644 
     59test/unit/FoswikiTestCase.pm 0644 
    6060test/unit/TemplatesTests.pm 0644 
    6161test/unit/TimeTests.pm 0644 
     
    6565test/unit/ViewParamSectionTests.pm 0755 
    6666test/unit/ViewScriptTests.pm 0644 
    67 pub/TWiki/UnitTestContrib/wikiringlogo20x20.png 0660 
    68 pub/TWiki/UnitTestContrib/logo.gif 0660 
    69 data/TWiki/UnitTestContrib.txt 0660 
     67pub/Foswiki/UnitTestContrib/wikiringlogo20x20.png 0660 
     68pub/Foswiki/UnitTestContrib/logo.gif 0660 
     69data/Foswiki/UnitTestContrib.txt 0660 
  • trunk/UnitTestContrib/lib/Foswiki/Contrib/UnitTestContrib/build.pl

    r14 r816  
    33    unshift @INC, split( /:/, $ENV{TWIKI_LIBS} ); 
    44} 
    5 use TWiki::Contrib::Build; 
     5use Foswiki::Contrib::Build; 
    66 
    77# Create the build object 
    8 $build = new TWiki::Contrib::Build('UnitTestContrib'); 
     8$build = new Foswiki::Contrib::Build('UnitTestContrib'); 
    99 
    1010# (Optional) Set the details of the repository for uploads. 
  • trunk/UnitTestContrib/lib/Foswiki/UI/Test.pm

    r15 r816  
    1 package TWiki::UI::Test; 
     1package Foswiki::UI::Test; 
    22 
    33use strict; 
  • trunk/UnitTestContrib/lib/Unit/Request.pm

    r14 r816  
    33 
    44BEGIN { 
    5     use TWiki; 
     5    use Foswiki; 
    66    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'; 
    1212    } 
    1313    else { 
  • trunk/UnitTestContrib/lib/Unit/Response.pm

    r14 r816  
    55 
    66BEGIN { 
    7     use TWiki; 
     7    use Foswiki; 
    88    use CGI; 
    9     my ($release) = $TWiki::RELEASE =~ /-(\d+)\.\d+\.\d+/; 
     9    my ($release) = $Foswiki::RELEASE =~ /-(\d+)\.\d+\.\d+/; 
    1010    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 = 
    1717          sub { my $t = $twiki_new->(@_); $res = $t->{response}; return $t }; 
    1818    } 
     
    2020        @Unit::Response::ISA = qw(CGI); 
    2121        *charset = sub { shift; CGI::charset(@_) }; 
    22         my $twiki_new = \&TWiki::new; 
    23         *TWiki::new = 
     22        my $twiki_new = \&Foswiki::new; 
     23        *Foswiki::new = 
    2424          sub { my $t = $twiki_new->(@_); $res = $t->{cgiQuery}; return $t }; 
    2525    } 
    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; }; 
    2828} 
    2929 
    3030sub 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" 
    3232      unless defined $res; 
    3333    bless $res, __PACKAGE__ unless $res->isa(__PACKAGE__); 
  • trunk/UnitTestContrib/lib/Unit/TestCase.pm

    r14 r816  
    283283    my @params = @_; 
    284284    my $result; 
    285     my ( $release ) = $TWiki::RELEASE =~ /-(\d+)\.\d+\.\d+/; 
     285    my ( $release ) = $Foswiki::RELEASE =~ /-(\d+)\.\d+\.\d+/; 
    286286 
    287287    { 
     
    294294    if ( $release >= 5 ) { 
    295295        $response = 
    296           UNIVERSAL::isa( $params[0], 'TWiki' ) 
     296          UNIVERSAL::isa( $params[0], 'Foswiki' ) 
    297297          ? $params[0]->{response} 
    298           : $TWiki::Plugins::SESSION->{response}; 
     298          : $Foswiki::Plugins::SESSION->{response}; 
    299299 
    300300        # Capture headers 
    301         TWiki::Engine->finalizeCookies($response); 
     301        Foswiki::Engine->finalizeCookies($response); 
    302302        foreach my $header ( keys %{ $response->headers } ) { 
    303303            $text .= $header . ': ' . $_ . "\x0D\x0A" 
  • trunk/UnitTestContrib/test/bin/TestRunner.pl

    r14 r816  
    2020 
    2121BEGIN { 
    22         $TWiki::cfg{Engine} = 'TWiki::Engine::CGI'; 
     22        $Foswiki::cfg{Engine} = 'Foswiki::Engine::CGI'; 
    2323    # root the tree 
    2424    my $here = Cwd::abs_path; 
     
    4444 
    4545use strict; 
    46 use TWiki;   # If you take this out then TestRunner.pl will fail on IndigoPerl 
     46use Foswiki;   # If you take this out then TestRunner.pl will fail on IndigoPerl 
    4747use Unit::TestRunner; 
    4848 
     
    8787if ($options{-clean}) { 
    8888    require File::Path; 
    89     my @x = glob "$TWiki::cfg{DataDir}/Temp*"; 
     89    my @x = glob "$Foswiki::cfg{DataDir}/Temp*"; 
    9090    File::Path::rmtree([@x]) if scalar(@x); 
    91     @x = glob "$TWiki::cfg{PubDir}/Temp*"; 
     91    @x = glob "$Foswiki::cfg{PubDir}/Temp*"; 
    9292    File::Path::rmtree([@x]) if scalar(@x); 
    9393} 
    9494 
    95 testForFiles($TWiki::cfg{DataDir}.'/Temp*'); 
    96 testForFiles($TWiki::cfg{PubDir}.'/Temp*'); 
     95testForFiles($Foswiki::cfg{DataDir}.'/Temp*'); 
     96testForFiles($Foswiki::cfg{PubDir}.'/Temp*'); 
    9797 
    9898my $testrunner = Unit::TestRunner->new(); 
  • trunk/UnitTestContrib/test/unit/AccessControlTests.pm

    r464 r816  
    33package AccessControlTests; 
    44 
    5 use base qw(TWikiFnTestCase); 
     5use base qw(FoswikiFnTestCase); 
    66 
    77sub new { 
     
    1111} 
    1212 
    13 use TWiki; 
    14 use TWiki::Access; 
     13use Foswiki; 
     14use Foswiki::Access; 
    1515 
    1616my $testTopic = "TemporaryTestTopic"; 
     
    2626    my $this = shift; 
    2727    $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}; 
    3131    $this->{twiki}->{store}->saveTopic($this->{twiki}->{user}, 
    32                                $TWiki::cfg{UsersWebName}, 
    33                                $TWiki::cfg{DefaultUserWikiName},''); 
     32                               $Foswiki::cfg{UsersWebName}, 
     33                               $Foswiki::cfg{DefaultUserWikiName},''); 
    3434    $this->registerUser( 
    3535        'white', 'Mr', "White", 'white@example.com'); 
     
    8787                                , undef); 
    8888    $this->{twiki}->finish(); 
    89     $this->{twiki} = new TWiki(); 
     89    $this->{twiki} = new Foswiki(); 
    9090 
    9191    $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrGreen); 
     
    107107                                , undef); 
    108108    $this->{twiki}->finish(); 
    109     $this->{twiki} = new TWiki(); 
     109    $this->{twiki} = new Foswiki(); 
    110110    $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrGreen); 
    111111    $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrYellow); 
     
    126126                                , undef); 
    127127    $this->{twiki}->finish(); 
    128     $this->{twiki} = new TWiki(); 
     128    $this->{twiki} = new Foswiki(); 
    129129    $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 
    130130    $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); 
     
    146146    my $topicquery = new Unit::Request( "" ); 
    147147    $topicquery->path_info("/$this->{test_web}/$testTopic"); 
    148     # renew TWiki, so WebPreferences gets re-read 
    149     $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); 
    154154    $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); 
    155155    $this->{twiki}->finish(); 
    156     $this->{twiki} = new TWiki(undef, $topicquery); 
     156    $this->{twiki} = new Foswiki(undef, $topicquery); 
    157157    $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrYellow); 
    158158    $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); 
    163163    $this->DENIED($this->{test_web},$testTopic,"view",$MrBlue); 
    164164} 
     
    174174THIS 
    175175                                , undef); 
    176     # renew TWiki, so WebPreferences gets re-read 
    177     $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(); 
    182182    $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); 
    183183    $this->{twiki}->finish(); 
    184     $this->{twiki} = new TWiki(); 
     184    $this->{twiki} = new Foswiki(); 
    185185    $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrYellow); 
    186186    $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(); 
    191191    $this->DENIED($this->{test_web},$testTopic,"view",$MrBlue); 
    192192} 
     
    202202THIS 
    203203                                , undef); 
    204     # renew TWiki, so WebPreferences gets re-read 
    205     $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(); 
    210210    $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); 
    211211    $this->{twiki}->finish(); 
    212     $this->{twiki} = new TWiki(); 
     212    $this->{twiki} = new Foswiki(); 
    213213    $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrYellow); 
    214214    $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(); 
    219219    $this->DENIED($this->{test_web},$testTopic,"view",$MrBlue); 
    220220} 
     
    222222sub test_denyweb { 
    223223    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}, 
    225225                                <<THIS 
    226226If DENYWEB is set to a list of wikiname 
     
    229229THIS 
    230230                                , undef); 
    231     # renew TWiki, so WebPreferences gets re-read 
    232     $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(); 
    234234    $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 
    235235                                "Null points"); 
     
    244244    my $this = shift; 
    245245    $this->{twiki}->{store}->saveTopic( 
    246         $currUser, $this->{test_web}, $TWiki::cfg{WebPrefsTopicName}, 
     246        $currUser, $this->{test_web}, $Foswiki::cfg{WebPrefsTopicName}, 
    247247        <<THIS 
    248248If ALLOWWEB is set to a list of wikinames 
     
    252252THIS 
    253253                                , undef); 
    254     # renew TWiki, so WebPreferences gets re-read 
    255     $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(); 
    257257    $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 
    258258                                "Null points"); 
     
    294294    $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 
    295295    $this->{twiki}->finish(); 
    296     $this->{twiki} = new TWiki(); 
     296    $this->{twiki} = new Foswiki(); 
    297297 
    298298    my $text = <<THIS; 
     
    307307    $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 
    308308    $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); 
    311311    my $args = 
    312312      { 
     
    325325    $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 
    326326    $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); 
    329329    my $args = 
    330330      { 
     
    346346    $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 
    347347    $this->{twiki}->finish(); 
    348     $this->{twiki} = new TWiki(); 
     348    $this->{twiki} = new Foswiki(); 
    349349    my $text = <<THIS; 
    350350%META:PREFERENCE{name="ALLOWTOPICVIEW" title="ALLOWTOPICVIEW" type="Set" value="%25USERSWEB%25.MrGreen"}% 
     
    358358    $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, 'Empty'); 
    359359    $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); 
    362362    my $args = 
    363363      { 
     
    378378    my $subweb = "$this->{test_web}.SubWeb"; 
    379379 
    380     $TWiki::cfg{EnableHierarchicalWebs} = 1; 
     380    $Foswiki::cfg{EnableHierarchicalWebs} = 1; 
    381381    $this->{twiki}->{store}->createWeb($this->{twiki}->{user}, $subweb); 
    382382    $this->{twiki}->{store}->saveTopic( $currUser, $this->{test_web}, $testTopic, "Nowt"); 
    383383    $this->{twiki}->{store}->saveTopic( 
    384         $currUser, $this->{test_web}, $TWiki::cfg{WebPrefsTopicName}, 
     384        $currUser, $this->{test_web}, $Foswiki::cfg{WebPrefsTopicName}, 
    385385        <<THIS, undef); 
    386386\t* Set ALLOWWEBVIEW = MrGreen 
    387387THIS 
    388388    $this->{twiki}->{store}->saveTopic( 
    389         $currUser, $subweb, $TWiki::cfg{WebPrefsTopicName}, 
     389        $currUser, $subweb, $Foswiki::cfg{WebPrefsTopicName}, 
    390390        <<THIS, undef); 
    391391\t* Set ALLOWWEBVIEW = MrOrange 
    392392THIS 
    393393    $this->{twiki}->finish(); 
    394     $this->{twiki} = new TWiki(); 
     394    $this->{twiki} = new Foswiki(); 
    395395    $this->PERMITTED($subweb,$testTopic,"VIEW",$MrOrange); 
    396396    $this->DENIED($subweb,$testTopic,"VIEW",$MrGreen); 
     
    410410                                , undef); 
    411411    $this->{twiki}->finish(); 
    412     $this->{twiki} = new TWiki(); 
     412    $this->{twiki} = new Foswiki(); 
    413413    $this->PERMITTED($this->{test_web},$testTopic,"VIEW",$MrOrange); 
    414414    $this->DENIED($this->{test_web},$testTopic,"VIEW",$MrGreen); 
  • trunk/UnitTestContrib/test/unit/AddToHeadTests.pm

    r14 r816  
    55package AddToHeadTests; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
     
    7171    my $topicName = $this->{test_topic}; 
    7272    my $webName   = $this->{test_web}; 
    73     TWiki::Func::addToHEAD("first", "QQQ"); 
     73    Foswiki::Func::addToHEAD("first", "QQQ"); 
    7474    my $raw_tag  = '%RENDERHEAD%'; 
    7575    my $expected = "<!-- first --> QQQ"; 
     
    8484    my $topicName = $this->{test_topic}; 
    8585    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"); 
    8989    my $raw_tag  = '%RENDERHEAD%'; 
    9090    my $expected = "<!-- first --> QQQ FIRST" 
     
    107107    my $topicName = $this->{test_topic}; 
    108108    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" />'); 
    110110    my $raw_tag  = '%RENDERHEAD%'; 
    111111    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  
    33package AttrsTests; 
    44 
    5 use base qw(TWikiTestCase); 
    6  
    7 use TWiki::Attrs; 
     5use base qw(FoswikiTestCase); 
     6 
     7use Foswiki::Attrs; 
    88 
    99sub new { 
     
    1515        my $this = shift; 
    1616 
    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); 
    2222        $this->assert($attrs->isEmpty()); 
    2323} 
     
    2626        my $this = shift; 
    2727 
    28         my $attrs = TWiki::Attrs->new("a", 1); 
     28        my $attrs = Foswiki::Attrs->new("a", 1); 
    2929        $this->assert(!$attrs->isEmpty()); 
    3030        $this->assert_not_null($attrs->{"a"}); 
    3131        $this->assert_str_equals("1", $attrs->{"a"}); 
    3232 
    33         $attrs = TWiki::Attrs->new("a12g b987", 1); 
     33        $attrs = Foswiki::Attrs->new("a12g b987", 1); 
    3434        $this->assert_not_null($attrs->remove("a12g")); 
    3535        $this->assert_null($attrs->{"a12g"}); 
     
    3838        $this->assert($attrs->isEmpty(), "Fail ".$attrs->stringify()); 
    3939 
    40         $attrs = TWiki::Attrs->new("Acid AnhydrousCopperSulphate='white' X", 1); 
     40        $attrs = Foswiki::Attrs->new("Acid AnhydrousCopperSulphate='white' X", 1); 
    4141        $this->assert_not_null($attrs->remove("Acid")); 
    4242        $this->assert_not_null($attrs->remove("X")); 
     
    4848        my $this = shift; 
    4949 
    50         my $attrs = TWiki::Attrs->new("\"wibble\"", 1); 
     50        my $attrs = Foswiki::Attrs->new("\"wibble\"", 1); 
    5151        $this->assert(!$attrs->isEmpty()); 
    5252        $this->assert_str_equals("wibble", $attrs->remove("_DEFAULT")); 
     
    5454        $this->assert($attrs->isEmpty()); 
    5555 
    56         $attrs = TWiki::Attrs->new("\"wibble\" \"fleegle\"", 1); 
     56        $attrs = Foswiki::Attrs->new("\"wibble\" \"fleegle\"", 1); 
    5757        $this->assert_str_equals("wibble", $attrs->remove("_DEFAULT")); 
    5858        $this->assert($attrs->isEmpty()); 
     
    6262        my $this = shift; 
    6363 
    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); 
    6565        $this->assert_str_equals("val1", $attrs->remove("var1")); 
    6666        $this->assert_str_equals("val2", $attrs->remove("var2")); 
     
    7373        my $this = shift; 
    7474 
    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); 
    7676        $this->assert_str_equals("\"val1", $attrs->remove("var1")); 
    7777        $this->assert_str_equals("\'val2", $attrs->remove("var2")); 
     
    8484        my $this = shift; 
    8585 
    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); 
    8787        $this->assert_str_equals("val 1", $attrs->remove("var1")); 
    8888        $this->assert_str_equals("val 2", $attrs->remove("var2")); 
     
    9595        my $this = shift; 
    9696 
    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); 
    9898        $this->assert_str_equals("val 1", $attrs->remove("var1")); 
    9999        $this->assert_str_equals("val 2", $attrs->remove("var2")); 
     
    106106        my $this = shift; 
    107107 
    108         my $attrs = TWiki::Attrs->new("a ='\"', b=\"'\" \"'\"", 1); 
     108        my $attrs = Foswiki::Attrs->new("a ='\"', b=\"'\" \"'\"", 1); 
    109109        $this->assert_str_equals("\"", $attrs->remove("a")); 
    110110        $this->assert_str_equals("'", $attrs->remove("b")); 
    111111        $this->assert_str_equals("'", $attrs->remove("_DEFAULT")); 
    112112        $this->assert($attrs->isEmpty()); 
    113         $attrs = TWiki::Attrs->new("'\"'", 1); 
     113        $attrs = Foswiki::Attrs->new("'\"'", 1); 
    114114        $this->assert_str_equals("\"", $attrs->remove("_DEFAULT")); 
    115115        $this->assert($attrs->isEmpty()); 
     
    119119        my $this = shift; 
    120120 
    121         my $attrs = TWiki::Attrs->new("a ='\"', b=\"'\" \"'\"", 1); 
     121        my $attrs = Foswiki::Attrs->new("a ='\"', b=\"'\" \"'\"", 1); 
    122122        my $s = $attrs->stringify(); 
    123         $attrs = TWiki::Attrs->new($attrs->stringify(), 1); 
     123        $attrs = Foswiki::Attrs->new($attrs->stringify(), 1); 
    124124        $this->assert_str_equals("\"", $attrs->remove("a")); 
    125125        $this->assert_str_equals("'", $attrs->remove("b")); 
     
    133133    my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 
    134134    $this->assert_str_equals('abc def="ghi" jkl', 
    135                              TWiki::Attrs::extractValue($s)); 
     135                             Foswiki::Attrs::extractValue($s)); 
    136136} 
    137137 
     
    141141    my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 
    142142    $this->assert_str_equals('ghi', 
    143                              TWiki::Attrs::extractValue($s, "def")); 
     143                             Foswiki::Attrs::extractValue($s, "def")); 
    144144} 
    145145 
     
    149149    my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 
    150150    $this->assert_str_equals('', 
    151                              TWiki::Attrs::extractValue($s, "jkl")); 
     151                             Foswiki::Attrs::extractValue($s, "jkl")); 
    152152} 
    153153 
     
    157157    my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 
    158158    $this->assert_str_equals(' stu=', 
    159                              TWiki::Attrs::extractValue($s, 'pqr')); 
     159                             Foswiki::Attrs::extractValue($s, 'pqr')); 
    160160} 
    161161 
     
    165165    my $s = '"abc def="ghi" jkl" def="mno" pqr=" stu="vwx""'; 
    166166    $this->assert_str_equals('vwx', 
    167                              TWiki::Attrs::extractValue($s, 'stu')); 
     167                             Foswiki::Attrs::extractValue($s, 'stu')); 
    168168} 
    169169 
     
    217217    my( $this, $s ) = @_; 
    218218 
    219     my $new = new TWiki::Attrs($s,0); 
     219    my $new = new Foswiki::Attrs($s,0); 
    220220    my %old = extractParameters($s); 
    221221 
     
    253253    my $this = shift; 
    254254    my $s = "\nBarf"; 
    255     my $new = new TWiki::Attrs($s,0); 
     255    my $new = new Foswiki::Attrs($s,0); 
    256256    $s = "Barf\n"; 
    257     $new = new TWiki::Attrs($s,0); 
     257    $new = new Foswiki::Attrs($s,0); 
    258258    $s = "\n"; 
    259     $new = new TWiki::Attrs($s,0); 
     259    $new = new Foswiki::Attrs($s,0); 
    260260    $s = "\"The\nCat\" format=\"Shat\nOn\nThe\nMat\""; 
    261261    $this->check_string( $s ); 
     
    265265    my $this = shift; 
    266266    my $s = "   Barf"; 
    267     my $new = new TWiki::Attrs($s,0); 
     267    my $new = new Foswiki::Attrs($s,0); 
    268268    $this->assert_str_equals($s, $new->{_RAW}); 
    269269} 
  • trunk/UnitTestContrib/test/unit/AutoAttachTests.pm

    r492 r816  
    33# Test cases: 
    44# 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 TWiki 
     5# 2) Add attachmentAdded into the attachment area for that topic, circumventing Foswiki 
    66# 3) Turn autoattach = on. Ask for the list of attachments. attachmentAdded should appear. attachmentMissing should not. 
    77 
    88package AutoAttachTests; 
    9 use base qw(TWikiFnTestCase); 
     9use base qw(FoswikiFnTestCase); 
    1010 
    1111use strict; 
    12 use TWiki; 
    13 use TWiki::Meta; 
     12use Foswiki; 
     13use Foswiki::Meta; 
    1414use Error qw( :try ); 
    15 use TWiki::UI::Save; 
    16 use TWiki::OopsException; 
     15use Foswiki::UI::Save; 
     16use Foswiki::OopsException; 
    1717use Devel::Symdump; 
    1818 
     
    7272    my $this = shift; 
    7373    my ($topic, @filenames) = @_; 
    74     my $dir = $TWiki::cfg{PubDir}; 
     74    my $dir = $Foswiki::cfg{PubDir}; 
    7575    $dir = "$dir/$this->{test_web}/$topic"; 
    7676    #print STDERR "DEBUG: dir=$dir\n"; 
     
    9494 
    9595sub 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"; 
    9999 
    100100    my $this = shift;  
     
    103103    $this->verify_normal_attachment($topic, "afile.txt"); 
    104104    $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"); 
    106106    $this->addMissingAttachment($topic, 'ressurectedComment.txt', 'ressurected attachment comment'); 
    107107    $this->sneakAttachmentsAddedToTopic($topic, 'sneakedfile1.txt','sneakedfile2.txt', 'commavfilesshouldbeignored2.txt,v','_hiddenAttachment.txt', 'ressurectedComment.txt'); 
     
    169169    $this->assert($this->{twiki}->{store}->topicExists($this->{test_web}, $topic)); 
    170170 
    171     open( FILE, ">$TWiki::cfg{TempfileDir}/$attachment" ); 
     171    open( FILE, ">$Foswiki::cfg{TempfileDir}/$attachment" ); 
    172172    print FILE "Test attachment\n"; 
    173173    close(FILE); 
     
    179179    $this->{twiki}->{store}->saveAttachment( 
    180180        $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"; 
    184184 
    185185    # Check revision number 
  • trunk/UnitTestContrib/test/unit/CGIEngineTests.pm

    r15 r816  
    99 
    1010BEGIN { 
    11     $TWiki::cfg{Engine} = 'TWiki::Engine::CGI'; 
     11    $Foswiki::cfg{Engine} = 'Foswiki::Engine::CGI'; 
    1212} 
    1313 
    14 use TWiki; 
    15 use TWiki::Response; 
    16 use TWiki::UI; 
     14use Foswiki; 
     15use Foswiki::Response; 
     16use Foswiki::UI; 
    1717 
    1818use File::Temp; 
     
    2020use Data::Dumper; 
    2121 
    22 $TWiki::cfg{SwitchBoard}{test} = [ 'TWiki::UI::Test', 'test', { test => 1 } ]; 
     22$Foswiki::cfg{SwitchBoard}{test} = [ 'Foswiki::UI::Test', 'test', { test => 1 } ]; 
    2323 
    2424sub cgi_env { 
     
    4242 
    4343    %ENV = cgi_env; 
    44     my $res = new TWiki::Response(); 
     44    my $res = new Foswiki::Response(); 
    4545    $res->header(-type => 'text/plain', charset => 'iso8859-1'); 
    4646    $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)); 
    4848    my $out = ''; 
    4949    open my $stdout, '>&', \*STDOUT; 
    5050    close STDOUT; 
    5151    open STDOUT, '>', \$out; 
    52     $TWiki::engine->run(); 
     52    $Foswiki::engine->run(); 
    5353    open STDOUT, '>&', $stdout; 
    5454    $out =~ /(?:\r?\n){2}(.*)/s; 
  • trunk/UnitTestContrib/test/unit/ClientTests.pm

    r672 r816  
    66# LoginManager.pm compiles okay. 
    77 
    8 use base qw(TWikiFnTestCase); 
     8use base qw(FoswikiFnTestCase); 
    99 
    1010use Unit::Request; 
    1111use Error qw( :try ); 
    1212 
    13 use TWiki; 
    14 use TWiki::LoginManager; 
    15 use TWiki::UI::View; 
    16 use TWiki::UI::Edit; 
     13use Foswiki; 
     14use Foswiki::LoginManager; 
     15use Foswiki::UI::View; 
     16use Foswiki::UI::Edit; 
    1717 
    18 my $agent = $TWiki::cfg{Register}{RegistrationAgentWikiName}; 
     18my $agent = $Foswiki::cfg{Register}{RegistrationAgentWikiName}; 
    1919my $userLogin; 
    2020my $userWikiName; 
     
    3232 
    3333sub TemplateLoginManager { 
    34     $TWiki::cfg{LoginManager} = 'TWiki::LoginManager::TemplateLogin'; 
     34    $Foswiki::cfg{LoginManager} = 'Foswiki::LoginManager::TemplateLogin'; 
    3535} 
    3636 
    3737sub ApacheLoginManager { 
    38     $TWiki::cfg{LoginManager} = 'TWiki::LoginManager::ApacheLogin'; 
     38    $Foswiki::cfg{LoginManager} = 'Foswiki::LoginManager::ApacheLogin'; 
    3939} 
    4040 
    4141sub NoLoginManager { 
    42     $TWiki::cfg{LoginManager} = 'none'; 
     42    $Foswiki::cfg{LoginManager} = 'none'; 
    4343} 
    4444 
    4545sub BaseUserMapping { 
    4646    my $this = shift; 
    47     $TWiki::cfg{UserMappingManager} = 'TWiki::Users::BaseUserMapping'; 
     47    $Foswiki::cfg{UserMappingManager} = 'Foswiki::Users::BaseUserMapping'; 
    4848    $this->set_up_for_verify(); 
    4949} 
     
    5151sub TopicUserMapping { 
    5252    my $this = shift; 
    53     $TWiki::cfg{UserMappingManager} = 'TWiki::Users::TopicUserMapping'; 
     53    $Foswiki::cfg{UserMappingManager} = 'Foswiki::Users::TopicUserMapping'; 
    5454    $this->set_up_for_verify(); 
    5555} 
     
    6767 
    6868    $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}; 
    7777} 
    7878 
     
    8585            $this->annotate("create $userLogin user - cUID = $user_id\n"); 
    8686    } else { 
    87         $userLogin = $TWiki::cfg{AdminUserLogin}; 
     87        $userLogin = $Foswiki::cfg{AdminUserLogin}; 
    8888        $user_id = $this->{twiki}->{users}->getCanonicalUserID($userLogin); 
    8989        $userWikiName = $this->{twiki}->{users}->getWikiName($user_id); 
     
    106106    my ( $query, $text ); 
    107107 
    108     #close this TWiki session - its using the wrong mapper and login 
     108    #close this Foswiki session - its using the wrong mapper and login 
    109109    $this->{twiki}->finish(); 
    110110 
    111111    $query = new Unit::Request(); 
    112112    $query->path_info( "/$this->{test_web}/$this->{test_topic}" ); 
    113     $this->{twiki} = new TWiki( undef, $query ); 
     113    $this->{twiki} = new Foswiki( undef, $query ); 
    114114 
    115115    $this->set_up_user(); 
    116116    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 { 
    119119        $this->assert(0,shift->stringify()); 
    120120    } catch Error::Simple with { 
     
    126126    $this->{twiki}->finish(); 
    127127 
    128     $this->{twiki} = new TWiki( undef, $query ); 
     128    $this->{twiki} = new Foswiki( undef, $query ); 
    129129 
    130130    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 { 
    133133    } catch Error::Simple with { 
    134134        $this->assert(0,shift->stringify()); 
    135135    } otherwise { 
    136         unless( $TWiki::cfg{LoginManager} eq 'none' ) { 
     136        unless( $Foswiki::cfg{LoginManager} eq 'none' ) { 
    137137            $this->assert(0, "expected an access control exception: ". 
    138                             $TWiki::cfg{LoginManager}."\n$text"); 
     138                            $Foswiki::cfg{LoginManager}."\n$text"); 
    139139        } 
    140140    }; 
     
    146146    $this->annotate("new session using $userLogin\n"); 
    147147 
    148     $this->{twiki} = new TWiki( $userLogin, $query ); 
     148    $this->{twiki} = new Foswiki( $userLogin, $query ); 
    149149 
    150150    #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); 
    152152} 
    153153 
     
    161161    my $secret = "a big mole on my left buttock"; 
    162162    my $crypted = crypt($secret, "12"); 
    163     $TWiki::cfg{Password} = $crypted; 
     163    $Foswiki::cfg{Password} = $crypted; 
    164164 
    165165    my $query = new Unit::Request({ 
    166         username => [ $TWiki::cfg{AdminUserLogin} ], 
     166        username => [ $Foswiki::cfg{AdminUserLogin} ], 
    167167        password => [ $secret ], 
    168168        Logon => [ 1 ], 
     
    171171    $query->path_info( "/$this->{test_web}/$this->{test_topic}" ); 
    172172 
    173     $this->{twiki} = new TWiki(undef, $query); 
     173    $this->{twiki} = new Foswiki(undef, $query); 
    174174    my ($text, $result) = $this->capture( 
    175175        sub { 
  • trunk/UnitTestContrib/test/unit/ConfigureTests.pm

    r14 r816  
    33use strict; 
    44 
    5 use base qw(TWikiTestCase); 
     5use base qw(FoswikiTestCase); 
    66 
    77use Error qw( :try ); 
    88use File::Temp; 
    99 
    10 use TWiki::Configure::TWikiCfg; 
    11 use TWiki::Configure::Root; 
    12 use TWiki::Configure::Valuer; 
    13 use TWiki::Configure::UI; 
     10use Foswiki::Configure::FoswikiCfg; 
     11use Foswiki::Configure::Root; 
     12use Foswiki::Configure::Valuer; 
     13use Foswiki::Configure::UI; 
    1414 
    1515# Parse a cfg; change some values; save the changes 
     
    2020    my %cfg = (guff=>"muff"); 
    2121 
    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(); 
    2424    my ($fh, $fhname) = File::Temp::tempfile(unlink=>1); 
    2525    print $fh <<'EXAMPLE'; 
     
    4545#---+ Three 
    4646# ---++++ 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'; 
    49491; 
    5050EXAMPLE 
     
    5656    } 
    5757 
    58     TWiki::Configure::TWikiCfg::_parse($fhname, $root, 1); 
     58    Foswiki::Configure::FoswikiCfg::_parse($fhname, $root, 1); 
    5959 
    6060    # nothing should have changed 
    61     my $saver = new TWiki::Configure::TWikiCfg(); 
     61    my $saver = new Foswiki::Configure::FoswikiCfg(); 
    6262    $saver->{valuer} = $valuer; 
    6363    $saver->{root} = $root; 
     
    6969    $cfg{MandatoryPath} = 'fixed'; 
    7070    $cfg{MandatoryBoolean} = 0; 
    71     $cfg{Types}{Chosen} = 'TWiki::Configure::Types::STRING'; 
     71    $cfg{Types}{Chosen} = 'Foswiki::Configure::Types::STRING'; 
    7272    $cfg{OptionalRegex} = qr/^X*$/; 
    7373    $cfg{DontIgnore} = 'now is'; 
     
    7575    $out = $saver->_save(); 
    7676    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'; 
    82821; 
    8383EXAMPLE 
     
    9292sub test_2parse { 
    9393    my $this = shift; 
    94     my $root = new TWiki::Configure::Root(); 
     94    my $root = new Foswiki::Configure::Root(); 
    9595 
    9696    $this->assert_null($root->getValueObject('{One}')); 
     
    100100    print $f1 <<'EXAMPLE'; 
    101101# **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'; 
     1031; 
     104EXAMPLE 
     105    $f1->close(); 
     106    Foswiki::Configure::FoswikiCfg::_parse($f1name, $root); 
    107107 
    108108    $this->assert_not_null($root->getValueObject('{One}')); 
     
    112112    print $f2 <<'EXAMPLE'; 
    113113# **STRING 10** 
    114 $TWiki::cfg{Two} = 'Two'; 
     114$Foswiki::cfg{Two} = 'Two'; 
    1151151; 
    116116EXAMPLE 
    117117    $f2->close(); 
    118     TWiki::Configure::TWikiCfg::_parse($f2name, $root); 
     118    Foswiki::Configure::FoswikiCfg::_parse($f2name, $root); 
    119119 
    120120    # make sure they are both present 
     
    125125sub test_loadpluggables { 
    126126    my $this = shift; 
    127     my $root = new TWiki::Configure::Root(); 
     127    my $root = new Foswiki::Configure::Root(); 
    128128    my ($f1, $f1name) = File::Temp::tempfile(unlink=>1); 
    129129    print $f1 <<'EXAMPLE'; 
    130130# *LANGUAGES* 
    131131# *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; 
     1331; 
     134EXAMPLE 
     135    $f1->close(); 
     136    Foswiki::Configure::FoswikiCfg::_parse($f1name, $root); 
    137137    my $vo = $root->getValueObject('{Plugins}{CommentPlugin}{Enabled}'); 
    138138    $this->assert_not_null($vo); 
     
    147147    my $this = shift; 
    148148 
    149     my $root = new TWiki::Configure::Root(); 
     149    my $root = new Foswiki::Configure::Root(); 
    150150 
    151151    my ($f1, $f1name) = File::Temp::tempfile(unlink=>1); 
     
    153153# **STRING 10** 
    154154# 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'; 
     1571; 
     158EXAMPLE 
     159    $f1->close(); 
     160    Foswiki::Configure::FoswikiCfg::_parse($f1name, $root); 
    161161 
    162162    my $vo = $root->getValueObject('{One}'); 
     
    168168    my ($f2, $f2name) = File::Temp::tempfile(unlink=>1); 
    169169    print $f2 <<'EXAMPLE'; 
    170 $TWiki::cfg{Two} = 'Two'; 
     170$Foswiki::cfg{Two} = 'Two'; 
    171171# **BOOLEAN 10** 
    172172# Bad description 
    173 $TWiki::cfg{One} = 'One'; 
    174 $TWiki::cfg{Three} = 'Three'; 
     173$Foswiki::cfg{One} = 'One'; 
     174$Foswiki::cfg{Three} = 'Three'; 
    1751751; 
    176176EXAMPLE 
    177177    $f2->close(); 
    178     TWiki::Configure::TWikiCfg::_parse($f2name, $root); 
     178    Foswiki::Configure::FoswikiCfg::_parse($f2name, $root); 
    179179 
    180180    $vo = $root->getValueObject('{One}'); 
     
    198198    $cfg{Two} = 'Two'; 
    199199    $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(); 
    202202 
    203203    my ($f1, $f1name) = File::Temp::tempfile(unlink=>1); 
     
    214214EXAMPLE 
    215215    $f1->close(); 
    216     TWiki::Configure::TWikiCfg::_parse($f1name, $root, 1); 
     216    Foswiki::Configure::FoswikiCfg::_parse($f1name, $root, 1); 
    217217    foreach my $k (keys %cfg) { 
    218218        $defaultCfg{$k} = $cfg{$k}; 
     
    221221    $cfg{Two} = 2; 
    222222    $cfg{Three} = 3; 
    223     my $saver = new TWiki::Configure::TWikiCfg(); 
     223    my $saver = new Foswiki::Configure::FoswikiCfg(); 
    224224    $saver->{valuer} = $valuer; 
    225225    $saver->{root} = $root; 
     
    227227    my $out = $saver->_save(); 
    228228    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; 
    2322321; 
    233233SPUTUM 
     
    237237sub test_UI { 
    238238    my $this = shift; 
    239     my $root = new TWiki::Configure::Root(); 
     239    my $root = new Foswiki::Configure::Root(); 
    240240    my %defaultCfg = (Value=>"before"); 
    241241    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'; 
    250250# ---+ Plugins 
    251251# *PLUGINS* 
     
    253253EXAMPLE 
    254254    $f1->close(); 
    255     TWiki::Configure::TWikiCfg::_parse($f1name, $root); 
     255    Foswiki::Configure::FoswikiCfg::_parse($f1name, $root); 
    256256 
    257257    foreach my $k (keys %cfg) { 
     
    262262    $defaultCfg{One} = "Eno"; 
    263263 
    264     my $ui = TWiki::Configure::UI::loadUI('Root', $root); 
     264    my $ui = Foswiki::Configure::UI::loadUI('Root', $root); 
    265265    my $result = $ui->ui($root, $valuer); 
    266266    # visual check 
     
    269269 
    270270#                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} )) { 
    273273#                print F '| ',gmtime(),' | ',$this->{user},' | ',$txt," |\n"; 
    274274#                close(F); 
  • trunk/UnitTestContrib/test/unit/EmptyTests.pm

    r14 r816  
    55package EmptyTests; 
    66 
    7 use base qw( TWikiTestCase ); 
     7use base qw( FoswikiTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
     
    1717    $this->SUPER::set_up(); 
    1818 
    19     # You can now safely modify $TWiki::cfg 
     19    # You can now safely modify $Foswiki::cfg 
    2020 
    2121    $topicquery = new Unit::Request( '' ); 
    2222    $topicquery->path_info( '/TestCases/WebHome' ); 
    2323    try { 
    24         $this->{twiki} = new TWiki( 'AdminUser' || '' ); 
     24        $this->{twiki} = new Foswiki( 'AdminUser' || '' ); 
    2525        my $user = $this->{twiki}->{user}; 
    2626 
     
    3737            $user, 
    3838            "Temporarytwikiweb", 
    39             "TWiki"); 
     39            "System"); 
    4040 
    4141        # Create a topic like this: 
     
    4444        # to make sure you fixture protects things like .htpasswd 
    4545 
    46     } catch TWiki::AccessControlException with { 
     46    } catch Foswiki::AccessControlException with { 
    4747        my $e = shift; 
    4848        die "???" unless $e; 
  • trunk/UnitTestContrib/test/unit/ExampleTests.pm

    r14 r816  
    44package ExampleTests; 
    55 
    6 use base qw(TWikiTestCase); 
     6use base qw(FoswikiTestCase); 
    77 
    8 use TWiki; 
     8use Foswiki; 
    99 
    1010sub set_up { 
  • trunk/UnitTestContrib/test/unit/ExceptionTests.pm

    r14 r816  
    11package ExceptionTests; 
    2 use base TWikiTestCase; 
     2use base FoswikiTestCase; 
    33 
    44use strict; 
    55 
    66use Error qw( :try ); 
    7 use TWiki::OopsException; 
    8 use TWiki::UI::Oops; 
     7use Foswiki::OopsException; 
     8use Foswiki::UI::Oops; 
    99 
    1010# Check an OopsException with one non-array parameter 
     
    1212    my $this = shift; 
    1313    try { 
    14         throw TWiki::OopsException( 
     14        throw Foswiki::OopsException( 
    1515            'templatename', 
    1616            web => 'webname', 
     
    1919            keep => 1, 
    2020            params => 'phlegm'); 
    21     } catch TWiki::OopsException with { 
     21    } catch Foswiki::OopsException with { 
    2222        my $e = shift; 
    23         $this->assert($e->isa('TWiki::OopsException')); 
     23        $this->assert($e->isa('Foswiki::OopsException')); 
    2424        $this->assert_str_equals('webname', $e->{web}); 
    2525        $this->assert_str_equals('topicname', $e->{topic}); 
     
    3737    my $this = shift; 
    3838    try { 
    39         throw TWiki::OopsException( 
     39        throw Foswiki::OopsException( 
    4040            'templatename', 
    4141            web => 'webname', 
    4242            topic => 'topicname', 
    4343            params => [ 'phlegm', '<pus>' ]); 
    44     } catch TWiki::OopsException with { 
     44    } catch Foswiki::OopsException with { 
    4545        my $e = shift; 
    46         $this->assert($e->isa('TWiki::OopsException')); 
     46        $this->assert($e->isa('Foswiki::OopsException')); 
    4747        $this->assert_str_equals('webname', $e->{web}); 
    4848        $this->assert_str_equals('topicname', $e->{topic}); 
     
    5656sub upchuck { 
    5757    my $session = shift; 
    58     my $e = new TWiki::OopsException( 
     58    my $e = new Foswiki::OopsException( 
    5959            'templatename', 
    6060            web => 'webname', 
     
    6666sub test_redirectOopsException { 
    6767    my $this = shift; 
    68     my $t = new TWiki(); 
     68    my $t = new Foswiki(); 
    6969    my ($output, $result) = $this->capture(\&upchuck, $t); 
    7070    $t->finish(); 
     
    7575sub test_AccessControlException { 
    7676    my $this = shift; 
    77     my $ace = new TWiki::AccessControlException( 
     77    my $ace = new Foswiki::AccessControlException( 
    7878        'FRY', 
    7979        'burger', 
     
    9696        param4 => 'phlegm', 
    9797        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, 
    100100                   "Flum", "DeDum", $query, 0); 
    101101    $this->assert_matches(qr/^phlegm$/m, $output); 
  • trunk/UnitTestContrib/test/unit/Fn_GROUPS.pm

    r664 r816  
    55package Fn_GROUPS; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
     
    3232| *Group* | *Members* | 
    3333| <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]] | 
    3535| [[TemporaryGROUPSUsersWeb.GropeGroup][GropeGroup]] | [[TemporaryGROUPSUsersWeb.ScumBag][ScumBag]] [[TemporaryGROUPSUsersWeb.WikiGuest][WikiGuest]] | 
    3636HUMPH 
  • trunk/UnitTestContrib/test/unit/Fn_IF.pm

    r664 r816  
    55package Fn_IF; 
    66 
    7 use base qw( TWikiFnTestCase ); 
    8  
    9 use TWiki; 
     7use base qw( FoswikiFnTestCase ); 
     8 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
     
    5959    $this->simpleTest( 
    6060        test => '$ WIKINAME = \'' 
    61           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) . "'", 
     61          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) . "'", 
    6262        then => 1, 
    6363        else => 0 
     
    6969    $this->simpleTest( 
    7070        test => '$ \'WIKINAME\' = \'' 
    71           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) . "'", 
     71          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) . "'", 
    7272        then => 1, 
    7373        else => 0 
     
    191191    my $this = shift; 
    192192    $this->simpleTest( 
    193         test => "\$PUBURLPATH='" . $TWiki::cfg{PubUrlPath} . "'", 
     193        test => "\$PUBURLPATH='" . $Foswiki::cfg{PubUrlPath} . "'", 
    194194        then => 1, 
    195195        else => 0 
     
    200200    my $this = shift; 
    201201    $this->simpleTest( 
    202         test => "\$'PUBURLPATH'='" . $TWiki::cfg{PubUrlPath} . "'", 
     202        test => "\$'PUBURLPATH'='" . $Foswiki::cfg{PubUrlPath} . "'", 
    203203        then => 1, 
    204204        else => 0 
     
    235235    $this->simpleTest( 
    236236        test => "d2n('2007-03-26')=" 
    237           . TWiki::Time::parseTime( '2007-03-26', 1 ), 
     237          . Foswiki::Time::parseTime( '2007-03-26', 1 ), 
    238238        then => 1, 
    239239        else => 0 
     
    280280    $this->simpleTest( 
    281281        test => "'" 
    282           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     282          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    283283          . "' ingroup 'WikiGuest'", 
    284284        then => 0, 
     
    291291    $this->simpleTest( 
    292292        test => "'" 
    293           . TWiki::Func::wikiToUserName( 
    294             TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     293          . Foswiki::Func::wikiToUserName( 
     294            Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    295295          ) 
    296296          . "' ingroup 'WikiGuest'", 
     
    314314    $this->simpleTest( 
    315315        test => "'" 
    316           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     316          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    317317          . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 
    318318        then => 0, 
     
    325325    $this->simpleTest( 
    326326        test => "'" 
    327           . TWiki::Func::wikiToUserName( 
    328             TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     327          . Foswiki::Func::wikiToUserName( 
     328            Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    329329          ) 
    330330          . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 
     
    350350    $this->simpleTest( 
    351351        test => "'" 
    352           . TWiki::Func::wikiToUserName( 
    353             TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     352          . Foswiki::Func::wikiToUserName( 
     353            Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    354354          ) 
    355           . "' ingroup '$TWiki::cfg{SuperAdminGroup}'", 
     355          . "' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 
    356356        then => 0, 
    357357        else => 1 
     
    363363    $this->simpleTest( 
    364364        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}'", 
    367367        then => 0, 
    368368        else => 1 
     
    375375        test => "'" 
    376376          . $this->{twiki}->{user} 
    377           . "' ingroup '$TWiki::cfg{SuperAdminGroup}'", 
     377          . "' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 
    378378        then => 0, 
    379379        else => 1 
     
    386386    $this->simpleTest( 
    387387        test => "'" 
    388           . TWiki::Func::wikiToUserName( 
    389             TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     388          . Foswiki::Func::wikiToUserName( 
     389            Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    390390          ) 
    391391          . "' ingroup 'GropeGroup'", 
     
    399399    $this->simpleTest( 
    400400        test => "'" 
    401           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     401          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    402402          . "' ingroup 'GropeGroup'", 
    403403        then => 1, 
     
    439439    my $this = shift; 
    440440    $this->simpleTest( 
    441         test => "'%USERNAME%' ingroup '$TWiki::cfg{SuperAdminGroup}'", 
     441        test => "'%USERNAME%' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 
    442442        then => 0, 
    443443        else => 1 
     
    477477    $this->simpleTest( 
    478478        test => "'%USERINFO{format=\"\$username\"}%' ingroup '" 
    479           . $TWiki::cfg{SuperAdminGroup} . "'", 
     479          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    480480        then => 0, 
    481481        else => 1 
     
    515515    $this->simpleTest( 
    516516        test => "'%USERINFO{format=\"\$wikiname\"}%' ingroup '" 
    517           . $TWiki::cfg{SuperAdminGroup} . "'", 
     517          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    518518        then => 0, 
    519519        else => 1 
     
    553553    $this->simpleTest( 
    554554        test => "'%USERINFO{format=\"\$wikiusername\"}%' ingroup '" 
    555           . $TWiki::cfg{SuperAdminGroup} . "'", 
     555          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    556556        then => 0, 
    557557        else => 1 
     
    572572    $this->simpleTest( 
    573573        test => "'" 
    574           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     574          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    575575          . "' ingroup 'WikiGuest'", 
    576576        then => 0, 
     
    583583    $this->simpleTest( 
    584584        test => "'" 
    585           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     585          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    586586          . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 
    587587        then => 0, 
     
    594594    $this->simpleTest( 
    595595        test => "'" 
    596           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     596          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    597597          . "' ingroup '" 
    598           . $TWiki::cfg{SuperAdminGroup} . "'", 
     598          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    599599        then => 0, 
    600600        else => 1 
     
    606606    $this->simpleTest( 
    607607        test => "'" 
    608           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) 
     608          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 
    609609          . "' ingroup 'GropeGroup'", 
    610610        then => 1, 
     
    616616    my $this = shift; 
    617617    $this->simpleTest( 
    618         test => "'" . $TWiki::cfg{AdminUserWikiName} . "' ingroup 'WikiGuest'", 
     618        test => "'" . $Foswiki::cfg{AdminUserWikiName} . "' ingroup 'WikiGuest'", 
    619619        then => 0, 
    620620        else => 1 
     
    626626    $this->simpleTest( 
    627627        test => "'" 
    628           . $TWiki::cfg{AdminUserWikiName} 
     628          . $Foswiki::cfg{AdminUserWikiName} 
    629629          . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 
    630630        then => 0, 
     
    637637    $this->simpleTest( 
    638638        test => "'" 
    639           . $TWiki::cfg{AdminUserWikiName} 
     639          . $Foswiki::cfg{AdminUserWikiName} 
    640640          . "' ingroup '" 
    641           . $TWiki::cfg{SuperAdminGroup} . "'", 
     641          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    642642        then => 1, 
    643643        else => 0 
     
    648648    my $this = shift; 
    649649    $this->simpleTest( 
    650         test => "'" . $TWiki::cfg{AdminUserWikiName} . "' ingroup 'GropeGroup'", 
     650        test => "'" . $Foswiki::cfg{AdminUserWikiName} . "' ingroup 'GropeGroup'", 
    651651        then => 0, 
    652652        else => 1 
     
    658658    $this->simpleTest( 
    659659        test => "'" 
    660           . $TWiki::cfg{DefaultUserWikiName} 
     660          . $Foswiki::cfg{DefaultUserWikiName} 
    661661          . "' ingroup 'WikiGuest'", 
    662662        then => 0, 
     
    669669    $this->simpleTest( 
    670670        test => "'" 
    671           . $TWiki::cfg{DefaultUserWikiName} 
     671          . $Foswiki::cfg{DefaultUserWikiName} 
    672672          . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 
    673673        then => 0, 
     
    680680    $this->simpleTest( 
    681681        test => "'" 
    682           . $TWiki::cfg{DefaultUserWikiName} 
     682          . $Foswiki::cfg{DefaultUserWikiName} 
    683683          . "' ingroup '" 
    684           . $TWiki::cfg{SuperAdminGroup} . "'", 
     684          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    685685        then => 0, 
    686686        else => 1 
     
    691691    my $this = shift; 
    692692    $this->simpleTest( 
    693         test => "'$TWiki::cfg{DefaultUserWikiName}' ingroup 'GropeGroup'", 
     693        test => "'$Foswiki::cfg{DefaultUserWikiName}' ingroup 'GropeGroup'", 
    694694        then => 1, 
    695695        else => 0 
     
    700700    my $this = shift; 
    701701    $this->simpleTest( 
    702         test => "'" . $TWiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'", 
     702        test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'", 
    703703        then => 0, 
    704704        else => 1 
     
    710710    $this->simpleTest( 
    711711        test => "'" 
    712           . $TWiki::cfg{AdminUserLogin} 
     712          . $Foswiki::cfg{AdminUserLogin} 
    713713          . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 
    714714        then => 0, 
     
    721721    $this->simpleTest( 
    722722        test => "'" 
    723           . $TWiki::cfg{AdminUserLogin} 
     723          . $Foswiki::cfg{AdminUserLogin} 
    724724          . "' ingroup '" 
    725           . $TWiki::cfg{SuperAdminGroup} . "'", 
     725          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    726726        then => 1, 
    727727        else => 0 
     
    732732    my $this = shift; 
    733733    $this->simpleTest( 
    734         test => "'" . $TWiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'", 
     734        test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'", 
    735735        then => 0, 
    736736        else => 1 
     
    741741    my $this = shift; 
    742742    $this->simpleTest( 
    743         test => "'" . $TWiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'", 
     743        test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'", 
    744744        then => 0, 
    745745        else => 1 
     
    751751    $this->simpleTest( 
    752752        test => "'" 
    753           . $TWiki::cfg{DefaultUserLogin} 
     753          . $Foswiki::cfg{DefaultUserLogin} 
    754754          . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 
    755755        then => 0, 
     
    762762    $this->simpleTest( 
    763763        test => "'" 
    764           . $TWiki::cfg{DefaultUserLogin} 
     764          . $Foswiki::cfg{DefaultUserLogin} 
    765765          . "' ingroup '" 
    766           . $TWiki::cfg{SuperAdminGroup} . "'", 
     766          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    767767        then => 0, 
    768768        else => 1 
     
    773773    my $this = shift; 
    774774    $this->simpleTest( 
    775         test => "'" . $TWiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'", 
     775        test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'", 
    776776        then => 1, 
    777777        else => 0 
     
    782782    my $this = shift; 
    783783    $this->simpleTest( 
    784         test => "'" . $TWiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'", 
     784        test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'", 
    785785        then => 0, 
    786786        else => 1 
     
    792792    $this->simpleTest( 
    793793        test => "'" 
    794           . $TWiki::cfg{AdminUserLogin} 
     794          . $Foswiki::cfg{AdminUserLogin} 
    795795          . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 
    796796        then => 0, 
     
    803803    $this->simpleTest( 
    804804        test => "'" 
    805           . $TWiki::cfg{AdminUserLogin} 
     805          . $Foswiki::cfg{AdminUserLogin} 
    806806          . "' ingroup '" 
    807           . $TWiki::cfg{SuperAdminGroup} . "'", 
     807          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    808808        then => 1, 
    809809        else => 0 
     
    814814    my $this = shift; 
    815815    $this->simpleTest( 
    816         test => "'" . $TWiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'", 
     816        test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'", 
    817817        then => 0, 
    818818        else => 1 
     
    823823    my $this = shift; 
    824824    $this->simpleTest( 
    825         test => "'" . $TWiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'", 
     825        test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'", 
    826826        then => 0, 
    827827        else => 1 
     
    833833    $this->simpleTest( 
    834834        test => "'" 
    835           . $TWiki::cfg{DefaultUserLogin} 
     835          . $Foswiki::cfg{DefaultUserLogin} 
    836836          . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 
    837837        then => 0, 
     
    844844    $this->simpleTest( 
    845845        test => "'" 
    846           . $TWiki::cfg{DefaultUserLogin} 
     846          . $Foswiki::cfg{DefaultUserLogin} 
    847847          . "' ingroup '" 
    848           . $TWiki::cfg{SuperAdminGroup} . "'", 
     848          . $Foswiki::cfg{SuperAdminGroup} . "'", 
    849849        then => 0, 
    850850        else => 1 
     
    855855    my $this = shift; 
    856856    $this->simpleTest( 
    857         test => "'" . $TWiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'", 
     857        test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'", 
    858858        then => 1, 
    859859        else => 0 
     
    863863sub test_90 { 
    864864    my $this = shift; 
    865     $this->simpleTest( test => "isweb 'TWiki'", then => 1, else => 0 ); 
     865    $this->simpleTest( test => "isweb 'System'", then => 1, else => 0 ); 
    866866} 
    867867 
     
    873873sub test_92 { 
    874874    my $this = shift; 
    875     $this->simpleTest( test => "istopic \$'TWiki'", then => 0, else => 1 ); 
     875    $this->simpleTest( test => "istopic \$'System'", then => 0, else => 1 ); 
    876876} 
    877877 
     
    935935        "GropeGroup", 
    936936        "   * Set GROUP = " 
    937           . TWiki::Func::getWikiName( $this->{twiki}->{user} ) . "\n" 
     937          . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) . "\n" 
    938938    ); 
    939939 
     
    951951    my ( $this, %test ) = @_; 
    952952    $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'; 
    955955    $this->{request}->param('notempty','v'); 
    956956    $this->{request}->param('empty',''); 
     
    963963 
    964964    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} ); 
    966966    my $text = '%IF{"' 
    967967      . $test{test} 
     
    10381038sub test_ALLOWS_and_EXISTS { 
    10391039    my $this = shift; 
    1040     my $wn   = TWiki::Func::getWikiName( $this->{twiki}->{user} ); 
     1040    my $wn   = Foswiki::Func::getWikiName( $this->{twiki}->{user} ); 
    10411041    $this->{twiki}->{store} 
    10421042      ->saveTopic( $this->{twiki}->{user}, $this->{test_web}, "DeadDog", 
     
    11841184 
    11851185    $this->{twiki}->finish(); 
    1186     $this->{twiki} = new TWiki(); 
     1186    $this->{twiki} = new Foswiki(); 
    11871187    $this->{twiki}->{webName} = $this->{test_web};    # hack 
    11881188 
     
    12311231        $this->{twiki}->{store}->topicExists( $this->{test_web}, $topicName ) ); 
    12321232 
    1233 #TODO: these need to be moved into Fn_META and then implemented (its a really simple change in TWiki.pm 
     1233#TODO: these need to be moved into Fn_META and then implemented (its a really simple change in Foswiki.pm 
    12341234#    $this->assert_str_equals( 
    12351235#        $this->{twiki}->handleCommonTags( 
  • trunk/UnitTestContrib/test/unit/Fn_INCLUDE.pm

    r766 r816  
    55package Fn_INCLUDE; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
     
    55557 ($includedTopic) 
    56568 #$includedTopic 
    57 9 [[system.$includedTopic]] 
     579 [[System.$includedTopic]] 
    585810 [[$includedTopic]] 
    595911 [[http://fleegle][$includedTopic]] 
     
    81817 ($this->{other_web}.$includedTopic) 
    82828 #$includedTopic 
    83 9 [[system.$includedTopic]] 
     839 [[System.$includedTopic]] 
    848410 [[$this->{other_web}.$includedTopic][$includedTopic]] 
    858511 [[http://fleegle][$includedTopic]] 
  • trunk/UnitTestContrib/test/unit/Fn_NOP.pm

    r14 r816  
    55package Fn_NOP; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
  • trunk/UnitTestContrib/test/unit/Fn_REVINFO.pm

    r666 r816  
    44 
    55package Fn_REVINFO; 
    6 use base qw( TWikiFnTestCase ); 
     6use base qw( FoswikiFnTestCase ); 
    77 
    88use strict; 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
    1212sub new { 
    13     $TWiki::cfg{Register}{AllowLoginName} =  1; 
     13    $Foswiki::cfg{Register}{AllowLoginName} =  1; 
    1414    my $self = shift()->SUPER::new('REVINFO', @_); 
    1515    return $self; 
     
    3333    my $ui = $this->{twiki}->handleCommonTags( 
    3434        '%REVINFO%', $this->{test_web}, $this->{test_topic}); 
    35     my $guest = TWiki::Func::getWikiName(); 
     35    my $guest = Foswiki::Func::getWikiName(); 
    3636    unless ($ui =~ /^r1 - \d+ \w+ \d+ - \d+:\d+:\d+ - $this->{users_web}\.$guest$/) { 
    3737        $this->assert(0, $ui); 
     
    126126    # This test is specific to the "traditional" text database implementation, 
    127127    # 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') { 
    130130        return; 
    131131    } 
    132132    $this->assert(open( 
    133         F, '>', "$TWiki::cfg{DataDir}/$this->{test_web}/CrikeyMoses.txt")); 
     133        F, '>', "$Foswiki::cfg{DataDir}/$this->{test_web}/CrikeyMoses.txt")); 
    134134    print F <<'HERE'; 
    135135%META:TOPICINFO{author="ScumBag" date="1120846368" format="1.1" version="$Rev: 16686 $"}% 
     
    149149    # This test is specific to the "traditional" text database implementation, 
    150150    # 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') { 
    153153        return; 
    154154    } 
    155155    $this->assert(open( 
    156         F, '>', "$TWiki::cfg{DataDir}/$this->{test_web}/CrikeyMoses.txt")); 
     156        F, '>', "$Foswiki::cfg{DataDir}/$this->{test_web}/CrikeyMoses.txt")); 
    157157    print F <<'HERE'; 
    158158%META:TOPICINFO{author="scum" date="1120846368" format="1.1" version="$Rev: 16686 $"}% 
     
    172172    # This test is specific to the "traditional" text database implementation, 
    173173    # 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') { 
    176176        return; 
    177177    } 
    178178    $this->assert(open( 
    179         F, '>', "$TWiki::cfg{DataDir}/$this->{test_web}/GeeWillikins.txt")); 
     179        F, '>', "$Foswiki::cfg{DataDir}/$this->{test_web}/GeeWillikins.txt")); 
    180180    print F <<'HERE'; 
    181181%META:TOPICINFO{author="eltonjohn" date="1120846368" format="1.1" version="$Rev: 16686 $"}% 
    182182HERE 
    183183    close(F); 
    184     $TWiki::cfg{RenderLoggedInButUnknownUsers} = 0; 
     184    $Foswiki::cfg{RenderLoggedInButUnknownUsers} = 0; 
    185185    my $ui = $this->{twiki}->handleCommonTags( 
    186186        '%REVINFO{format="$username $wikiname $wikiusername"}%', 
    187187        $this->{test_web}, 'GeeWillikins'); 
    188188    $this->assert_str_equals("eltonjohn eltonjohn eltonjohn", $ui); 
    189     $TWiki::cfg{RenderLoggedInButUnknownUsers} = 1; 
     189    $Foswiki::cfg{RenderLoggedInButUnknownUsers} = 1; 
    190190    $ui = $this->{twiki}->handleCommonTags( 
    191191        '%REVINFO{format="$username $wikiname $wikiusername"}%', 
  • trunk/UnitTestContrib/test/unit/Fn_SCRIPTURL.pm

    r14 r816  
    55package Fn_SCRIPTURL; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
     
    1818    my $this = shift; 
    1919 
    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"; 
    2323 
    2424    my $result = $this->{twiki}->handleCommonTags("%SCRIPTURL%", $this->{test_web}, $this->{test_topic}); 
    2525    $this->assert_str_equals( 
    26         "$TWiki::cfg{DefaultUrlHost}$TWiki::cfg{ScriptUrlPath}", $result); 
     26        "$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{ScriptUrlPath}", $result); 
    2727 
    2828    $result = $this->{twiki}->handleCommonTags( 
    2929        "%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); 
    3131 
    3232    $result = $this->{twiki}->handleCommonTags( 
  • trunk/UnitTestContrib/test/unit/Fn_SEARCH.pm

    r649 r816  
    66package Fn_SEARCH; 
    77 
    8 use base qw( TWikiFnTestCase ); 
    9  
    10 use TWiki; 
     8use base qw( FoswikiFnTestCase ); 
     9 
     10use Foswiki; 
    1111use Error qw( :try ); 
    1212 
     
    3636    my (%salgs, %qalgs); 
    3737    foreach my $dir (@INC) { 
    38         if (opendir(D, "$dir/TWiki/Store/SearchAlgorithms")) { 
     38        if (opendir(D, "$dir/Foswiki/Store/SearchAlgorithms")) { 
    3939            foreach my $alg (readdir D) { 
    4040                next unless $alg =~ /^(.*)\.pm$/; 
     
    4444            closedir(D); 
    4545        } 
    46         if (opendir(D, "$dir/TWiki/Store/QueryAlgorithms")) { 
     46        if (opendir(D, "$dir/Foswiki/Store/QueryAlgorithms")) { 
    4747            foreach my $alg (readdir D) { 
    4848                next unless $alg =~ /^(.*)\.pm$/; 
     
    6060        eval <<SUB; 
    6161sub $fn { 
    62 require TWiki::Store::SearchAlgorithms::$alg; 
    63 \$TWiki::cfg{RCS}{SearchAlgorithm} = 'TWiki::Store::SearchAlgorithms::$alg'; } 
     62require Foswiki::Store::SearchAlgorithms::$alg; 
     63\$Foswiki::cfg{RCS}{SearchAlgorithm} = 'Foswiki::Store::SearchAlgorithms::$alg'; } 
    6464SUB 
    6565        die $@ if $@; 
     
    7171        eval <<SUB; 
    7272sub $fn { 
    73 require TWiki::Store::QueryAlgorithms::$alg; 
    74 \$TWiki::cfg{RCS}{QueryAlgorithm} = 'TWiki::Store::QueryAlgorithms::$alg'; } 
     73require Foswiki::Store::QueryAlgorithms::$alg; 
     74\$Foswiki::cfg{RCS}{QueryAlgorithm} = 'Foswiki::Store::QueryAlgorithms::$alg'; } 
    7575SUB 
    7676        die $@ if $@; 
     
    611611    $query->path_info("/$this->{test_web}/$this->{test_topic}"); 
    612612 
    613     $this->{twiki} = new TWiki(undef, $query); 
     613    $this->{twiki} = new Foswiki(undef, $query); 
    614614    $this->assert_str_equals($this->{test_web}, $this->{twiki}->{webName}); 
    615     $TWiki::Plugins::SESSION = $this->{twiki}; 
     615    $Foswiki::Plugins::SESSION = $this->{twiki}; 
    616616} 
    617617 
  • trunk/UnitTestContrib/test/unit/Fn_SECTION.pm

    r14 r816  
    55package Fn_SECTION; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
     
    2525    # Named section closed without being opened 
    2626    my $text = '0%ENDSECTION{"name"}%1'; 
    27     my( $nt, $s ) = TWiki::parseSections( $text ); 
     27    my( $nt, $s ) = Foswiki::parseSections( $text ); 
    2828    $this->assert_str_equals("01",$nt); 
    2929    $this->assert_str_equals('',dumpsec($s)); 
     
    3535    # Named section opened but never closed 
    3636    my $text = '0%STARTSECTION{"name"}%1'; 
    37     my ( $nt, $s ) = TWiki::parseSections( $text ); 
     37    my ( $nt, $s ) = Foswiki::parseSections( $text ); 
    3838    $this->assert_str_equals("01",$nt); 
    3939    $this->assert_str_equals('end="2" name="name" start="1" type="section"',dumpsec($s)); 
     
    4545    # Unnamed section closed without being opened 
    4646    my $text = '0%ENDSECTION%1'; 
    47     my ( $nt, $s ) = TWiki::parseSections( $text ); 
     47    my ( $nt, $s ) = Foswiki::parseSections( $text ); 
    4848    $this->assert_str_equals("01",$nt); 
    4949    $this->assert_str_equals('',dumpsec($s)); 
     
    5555    # Unnamed section opened but never closed 
    5656    my $text = '0%STARTSECTION%1'; 
    57     my ( $nt, $s ) = TWiki::parseSections( $text ); 
     57    my ( $nt, $s ) = Foswiki::parseSections( $text ); 
    5858    $this->assert_str_equals("01",$nt); 
    5959    $this->assert_str_equals('end="2" name="_SECTION0" start="1" type="section"',dumpsec($s)); 
     
    6565    # Unnamed section closed by opening another section of the same type 
    6666    my $text = '0%STARTSECTION%1%STARTSECTION%2'; 
    67     my ( $nt, $s ) = TWiki::parseSections( $text ); 
     67    my ( $nt, $s ) = Foswiki::parseSections( $text ); 
    6868    $this->assert_str_equals("012",$nt); 
    6969    $this->assert_str_equals('end="2" name="_SECTION0" start="1" type="section";end="3" name="_SECTION1" start="2" type="section"',dumpsec($s)); 
     
    7575    # Named section overlaps unnamed section before it 
    7676    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 ); 
    7878    $this->assert_str_equals("01234",$nt); 
    7979    $this->assert_str_equals('end="2" name="_SECTION0" start="1" type="section";end="4" name="named" start="2" type="section"',dumpsec($s)); 
     
    8585    # Named section overlaps unnamed section after it 
    8686    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 ); 
    8888    $this->assert_str_equals("01234",$nt); 
    8989    $this->assert_str_equals('end="3" name="named" start="1" type="section";end="4" name="_SECTION0" start="2" type="section"',dumpsec($s)); 
     
    9595    # Unnamed sections of different types overlap 
    9696    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 ); 
    9898    $this->assert_str_equals("01234",$nt); 
    9999    $this->assert_str_equals('end="3" name="_SECTION0" start="1" type="include";end="4" name="_SECTION1" start="2" type="templateonly"',dumpsec($s)); 
     
    105105    # Named sections of same type overlap 
    106106    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 ); 
    108108    $this->assert_str_equals("01234",$nt); 
    109109    $this->assert_str_equals('end="3" name="one" start="1" type="section";end="4" name="two" start="2" type="section"',dumpsec($s)); 
     
    115115    # Named sections nested 
    116116    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 ); 
    118118    $this->assert_str_equals("01234",$nt); 
    119119    $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  
    55package Fn_SEP; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
  • trunk/UnitTestContrib/test/unit/Fn_URLPARAM.pm

    r14 r816  
    44# 
    55package Fn_URLPARAM; 
    6 use base qw( TWikiFnTestCase ); 
     6use base qw( FoswikiFnTestCase ); 
    77 
    88use strict; 
  • trunk/UnitTestContrib/test/unit/Fn_USERINFO.pm

    r664 r816  
    55package Fn_USERINFO; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
    1212sub new { 
    13     $TWiki::cfg{Register}{AllowLoginName}    =  1; 
     13    $Foswiki::cfg{Register}{AllowLoginName}    =  1; 
    1414    my $self = shift()->SUPER::new('USERINFO', @_); 
    1515    return $self; 
     
    2828    my $this = shift; 
    2929 
    30     $TWiki::cfg{AntiSpam}{HideUserDetails} = 0; 
     30    $Foswiki::cfg{AntiSpam}{HideUserDetails} = 0; 
    3131    my $ui = $this->{twiki}->handleCommonTags( 
    3232        '%USERINFO%', $this->{test_web}, $this->{test_topic}); 
    3333    $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); 
    3535} 
    3636 
     
    3838    my $this = shift; 
    3939 
    40     $TWiki::cfg{AntiSpam}{HideUserDetails} = 0; 
     40    $Foswiki::cfg{AntiSpam}{HideUserDetails} = 0; 
    4141    my $ui = $this->{twiki}->handleCommonTags('%USERINFO{"ScumBag"}%', $this->{test_web}, $this->{test_topic}); 
    4242    $this->assert_str_equals( 
    43         "scum, $TWiki::cfg{UsersWebName}.ScumBag, scumbag\@example.com", $ui); 
     43        "scum, $Foswiki::cfg{UsersWebName}.ScumBag, scumbag\@example.com", $ui); 
    4444} 
    4545 
     
    4747    my $this = shift; 
    4848 
    49     $TWiki::cfg{AntiSpam}{HideUserDetails} = 0; 
     49    $Foswiki::cfg{AntiSpam}{HideUserDetails} = 0; 
    5050    my $ui = $this->{twiki}->handleCommonTags('%USERINFO{"scum"}%', $this->{test_web}, $this->{test_topic}); 
    5151    $this->assert_str_equals( 
    52         "scum, $TWiki::cfg{UsersWebName}.ScumBag, scumbag\@example.com", $ui); 
     52        "scum, $Foswiki::cfg{UsersWebName}.ScumBag, scumbag\@example.com", $ui); 
    5353} 
    5454 
     
    5656    my $this = shift; 
    5757 
    58     $TWiki::cfg{AntiSpam}{HideUserDetails} = 0; 
     58    $Foswiki::cfg{AntiSpam}{HideUserDetails} = 0; 
    5959    my $ui = $this->{twiki}->handleCommonTags('%USERINFO{"ScumBag" format="W$wikiusernameU$wikinameE$emailsG$groupsE"}%', $this->{test_web}, $this->{test_topic}); 
    6060    $this->assert_str_equals( 
    61         "W$TWiki::cfg{UsersWebName}.ScumBagUScumBagEscumbag\@example.comGGropeGroupE", $ui); 
     61        "W$Foswiki::cfg{UsersWebName}.ScumBagUScumBagEscumbag\@example.comGGropeGroupE", $ui); 
    6262 
    6363    my $guest_ui = $this->{twiki}->handleCommonTags('%USERINFO{"WikiGuest" format="W$wikiusernameU$wikinameE$emailsG$groupsE"}%', $this->{test_web}, $this->{test_topic}); 
    6464    $this->assert_str_equals( 
    65                 "WTemporaryUSERINFOUsersWeb.WikiGuestUWikiGuestEGTWikiBaseGroup, GropeGroupE", $guest_ui); 
     65                "WTemporaryUSERINFOUsersWeb.WikiGuestUWikiGuestEGBaseGroup, GropeGroupE", $guest_ui); 
    6666} 
    6767 
  • trunk/UnitTestContrib/test/unit/Fn_VAR.pm

    r14 r816  
    55package Fn_VAR; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    9 use TWiki; 
     9use Foswiki; 
    1010use Error qw( :try ); 
    1111 
     
    3232 
    3333    $this->{twiki}->finish(); 
    34     $this->{twiki} = new TWiki(); 
     34    $this->{twiki} = new Foswiki(); 
    3535 
    3636    $result = $this->{twiki}->handleCommonTags("%VAR{\"VAR\"}%", $this->{test_web}, $this->{test_topic}); 
  • trunk/UnitTestContrib/test/unit/FormDefTests.pm

    r412 r816  
    33package FormDefTests; 
    44 
    5 use base qw(TWikiFnTestCase); 
     5use base qw(FoswikiFnTestCase); 
    66 
    7 use TWiki; 
    8 use TWiki::Form; 
     7use Foswiki; 
     8use Foswiki::Form; 
    99use strict; 
    1010use Assert; 
     
    1919| Date | date | 30 | 
    2020FORM 
    21     my $def = TWiki::Form->new($this->{twiki}, $this->{test_web}, 'TestForm'); 
     21    my $def = Foswiki::Form->new($this->{twiki}, $this->{test_web}, 'TestForm'); 
    2222 
    2323    $this->assert_equals(1, scalar @{$def->getFields()}); 
     
    4242| Checky Egg | checkbox | 1      | 1,2,3,4   | Blip      |              | 
    4343FORM 
    44     my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
     44    my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
    4545 
    4646    $this->assert_equals(2, scalar @{$def->getFields()}); 
     
    8282| Age | 
    8383FORM 
    84     my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
     84    my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
    8585 
    8686    $this->assert_equals(1, scalar @{$def->getFields()}); 
     
    111111| Age | 
    112112FORM 
    113     my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
     113    my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
    114114 
    115115    $this->assert_equals(1, scalar @{$def->getFields()}); 
     
    139139| Beauty | 
    140140FORM 
    141     my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
     141    my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
    142142 
    143143    $this->assert_equals(1, scalar @{$def->getFields()}); 
     
    164164FORM 
    165165 
    166     my $def = new TWiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
     166    my $def = new Foswiki::Form($this->{twiki}, $this->{test_web}, 'TestForm'); 
    167167 
    168168    my $f = $def->getField('Ecks'); 
     
    186186      $this->{twiki}->{store}->readTopic( 
    187187          undef, $this->{test_web}, 'SplodgeOne'); 
    188     my $form = new TWiki::Form( 
     188    my $form = new Foswiki::Form( 
    189189        $this->{twiki}, $this->{test_web}, 'NonExistantForm', $meta); 
    190190    my $f = $form->getField('Ecks'); 
  • trunk/UnitTestContrib/test/unit/FormattingTests.pm