Changeset 1030


Ignore:
Timestamp:
11/28/08 01:46:53 (3 years ago)
Author:
KennethLavrsen
Message:

Item265: Updating unit tests for EditTablePlugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EditTablePlugin/test/unit/EditTablePlugin/EditTablePluginTests.pm

    r777 r1030  
    55package EditTablePluginTests; 
    66 
    7 use base qw( TWikiFnTestCase ); 
     7use base qw( FoswikiFnTestCase ); 
    88 
    99use strict; 
    10 use TWiki::UI::Save; 
     10use Foswiki::UI::Save; 
    1111use Error qw( :try ); 
    12 use TWiki::Plugins::EditTablePlugin; 
    13 use TWiki::Plugins::EditTablePlugin::Core; 
     12use Foswiki::Plugins::EditTablePlugin; 
     13use Foswiki::Plugins::EditTablePlugin::Core; 
    1414 
    1515sub new { 
     
    2424 
    2525    #    $this->{sup} = $this->{twiki}->getScriptUrl(0, 'view'); 
    26     $TWiki::cfg{AntiSpam}{RobotsAreWelcome} = 1; 
    27     $TWiki::cfg{AllowInlineScript} = 0; 
    28     $TWiki::cfg{TablePlugin}{Attributes} = 'tableborder="1" cellpadding="0" cellspacing="0" valign="top" headercolor="#252b37" headerbg="#d8dde4" headerbgsorted="#ced4dd" headercolor="#252b37" databg="#ffffff,#f2f3f6" databgsorted="#f3f5f7,#e7e9ee" tablerules="cols"'; 
     26    $Foswiki::cfg{AntiSpam}{RobotsAreWelcome} = 1; 
     27    $Foswiki::cfg{AllowInlineScript} = 0; 
     28    $Foswiki::cfg{TablePlugin}{Attributes} = 'tableborder="1" cellpadding="0" cellspacing="0" valign="top" headercolor="#252b37" headerbg="#d8dde4" headerbgsorted="#ced4dd" headercolor="#252b37" databg="#ffffff,#f2f3f6" databgsorted="#f3f5f7,#e7e9ee" tablerules="cols"'; 
    2929 
    3030    $ENV{SCRIPT_NAME} = '';    #  required by fake sort URLs in expected text 
     
    4141    if ($doRender) { 
    4242        $actual = 
    43           TWiki::Func::expandCommonVariables( $actual, $webName, $topicName ); 
     43          Foswiki::Func::expandCommonVariables( $actual, $webName, $topicName ); 
    4444        $actual = 
    4545          $session->renderer->getRenderedVersion( $actual, $webName, 
     
    6969    my $webName   = $this->{test_web}; 
    7070    my $viewUrlAuth = 
    71       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    72     my $pubUrlSystemWeb = 
    73       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     71      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     72    my $pubUrlSystemWeb = 
     73      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    7474 
    7575    $this->{twiki}->{store} 
     
    103103    my $webName   = $this->{test_web}; 
    104104    my $viewUrlAuth = 
    105       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    106     my $pubUrlSystemWeb = 
    107       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     105      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     106    my $pubUrlSystemWeb = 
     107      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    108108 
    109109    $this->{twiki}->{store} 
     
    138138    my $webName   = $this->{test_web}; 
    139139    my $viewUrlAuth = 
    140       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    141     my $pubUrlSystemWeb = 
    142       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     140      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     141    my $pubUrlSystemWeb = 
     142      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    143143 
    144144    my $query = new Unit::Request( 
     
    154154 
    155155    my $result = 
    156       TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
     156      Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
    157157 
    158158    my $expected = <<EXPECTED; 
     
    181181    my $webName   = $this->{test_web}; 
    182182    my $viewUrlAuth = 
    183       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    184     my $pubUrlSystemWeb = TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     183      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     184    my $pubUrlSystemWeb = Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    185185 
    186186    my $input = <<INPUT; 
     
    197197    $query->path_info("/$webName/$topicName"); 
    198198 
    199     my $twiki = new TWiki( undef, $query ); 
    200     $TWiki::Plugins::SESSION = $twiki; 
     199    my $twiki = new Foswiki( undef, $query ); 
     200    $Foswiki::Plugins::SESSION = $twiki; 
    201201 
    202202    my $result = 
    203       TWiki::Func::expandCommonVariables( $input, $this->{test_topic}, 
     203      Foswiki::Func::expandCommonVariables( $input, $this->{test_topic}, 
    204204        $this->{test_web}, undef ); 
    205205 
     
    230230    my $webName   = $this->{test_web}; 
    231231    my $viewUrlAuth = 
    232       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    233     my $pubUrlSystemWeb = 
    234       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     232      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     233    my $pubUrlSystemWeb = 
     234      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    235235 
    236236    my $input = <<INPUT; 
     
    248248    $query->path_info("/$webName/$topicName"); 
    249249 
    250     my $twiki = new TWiki( undef, $query ); 
    251     $TWiki::Plugins::SESSION = $twiki; 
     250    my $twiki = new Foswiki( undef, $query ); 
     251    $Foswiki::Plugins::SESSION = $twiki; 
    252252 
    253253    my $result = 
    254       TWiki::Func::expandCommonVariables( $input, $this->{test_topic}, 
     254      Foswiki::Func::expandCommonVariables( $input, $this->{test_topic}, 
    255255        $this->{test_web}, undef ); 
    256256 
     
    289289    $query->path_info("/$webName/$topicName"); 
    290290 
    291     $twiki = new TWiki( undef, $query ); 
    292     $TWiki::Plugins::SESSION = $twiki; 
     291    $twiki = new Foswiki( undef, $query ); 
     292    $Foswiki::Plugins::SESSION = $twiki; 
    293293 
    294294    $result = 
    295       TWiki::Func::expandCommonVariables( $input, $this->{test_topic}, 
     295      Foswiki::Func::expandCommonVariables( $input, $this->{test_topic}, 
    296296        $this->{test_web}, undef ); 
    297297 
     
    350350    $query->path_info("/$webName/$topicName"); 
    351351 
    352     TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
     352    Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
    353353        $input ); 
    354354 
    355     $twiki = new TWiki( undef, $query ); 
     355    $twiki = new Foswiki( undef, $query ); 
    356356        my $response = new Unit::Response; 
    357     $TWiki::Plugins::SESSION = $twiki; 
     357    $Foswiki::Plugins::SESSION = $twiki; 
    358358 
    359359    my ( $saveResult, $ecode ) = $this->capture( 
    360360        sub { 
    361             $response->body(TWiki::Func::expandCommonVariables( $input, 
     361            $response->body(Foswiki::Func::expandCommonVariables( $input, 
    362362                $this->{test_topic}, $this->{test_web}, undef ) ); 
    363363        } 
     
    365365    $this->assert( $saveResult =~ /Status: 302/ ); 
    366366 
    367     my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName ); 
     367    my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 
    368368 
    369369    $expected = <<NEWEXPECTED; 
     
    391391    my $webName   = $this->{test_web}; 
    392392    my $viewUrlAuth = 
    393       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    394     my $pubUrlSystemWeb = 
    395       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     393      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     394    my $pubUrlSystemWeb = 
     395      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    396396 
    397397    my $query = new Unit::Request( 
     
    408408INPUT 
    409409 
    410     my $twiki = new TWiki( undef, $query ); 
    411     $TWiki::Plugins::SESSION = $twiki; 
     410    my $twiki = new Foswiki( undef, $query ); 
     411    $Foswiki::Plugins::SESSION = $twiki; 
    412412    my $result = 
    413       TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
     413      Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
    414414 
    415415    my $expected = <<END; 
     
    456456    my $webName   = $this->{test_web}; 
    457457    my $viewUrlAuth = 
    458       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    459     my $pubPathSystemWeb = TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     458      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     459    my $pubPathSystemWeb = Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    460460 
    461461    my $query = new Unit::Request( 
     
    471471INPUT 
    472472 
    473     my $twiki = new TWiki( undef, $query ); 
    474     $TWiki::Plugins::SESSION = $twiki; 
     473    my $twiki = new Foswiki( undef, $query ); 
     474    $Foswiki::Plugins::SESSION = $twiki; 
    475475    my $result = 
    476       TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
     476      Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
    477477 
    478478    my $expected = <<END; 
     
    518518    my $webName   = $this->{test_web}; 
    519519    my $viewUrlAuth = 
    520       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    521     my $viewUrl = TWiki::Func::getScriptUrlPath() 
     520      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     521    my $viewUrl = Foswiki::Func::getScriptUrlPath() 
    522522      . "/view/$webName/$topicName" 
    523523      ;    # heck, how can I do this otherwise? I need the relative path 
    524524    my $pubUrlSystemWeb = 
    525       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     525      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    526526 
    527527    my $text = <<INPUT; 
     
    531531 
    532532    my $result = 
    533       TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
     533      Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
    534534 
    535535    my $expected = <<END; 
     
    553553END 
    554554 
    555     $expected =~ s/%PUBURLPATH%/$TWiki::cfg{PubUrlPath}/e; 
    556     $expected =~ s/%SYSTEMWEB%/$TWiki::cfg{SystemWebName}/g; 
     555    $expected =~ s/%PUBURLPATH%/$Foswiki::cfg{PubUrlPath}/e; 
     556    $expected =~ s/%SYSTEMWEB%/$Foswiki::cfg{SystemWebName}/g; 
    557557 
    558558    $this->do_testHtmlOutput( $expected, $result, 1 ); 
     
    565565    my $webName   = $this->{test_web}; 
    566566    my $viewUrlAuth = 
    567       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    568     my $pubUrlSystemWeb = 
    569       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     567      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     568    my $pubUrlSystemWeb = 
     569      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    570570    my $userName = $this->{users_web} . '.' . 'WikiGuest'; 
    571571 
     
    582582    $query->path_info("/$webName/$topicName"); 
    583583 
    584     my $twiki = new TWiki( undef, $query ); 
    585     $TWiki::Plugins::SESSION = $twiki; 
     584    my $twiki = new Foswiki( undef, $query ); 
     585    $Foswiki::Plugins::SESSION = $twiki; 
    586586    my $result = 
    587       TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
     587      Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
    588588 
    589589    my $expected = <<END; 
     
    623623    my $webName   = $this->{test_web}; 
    624624    my $viewUrlAuth = 
    625       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    626     my $pubUrlSystemWeb = 
    627       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     625      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     626    my $pubUrlSystemWeb = 
     627      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    628628 
    629629    my $input = <<INPUT; 
    630630%EDITTABLE{}% 
    631631| *URL* | *Name* | *By* | *Comment* | 
    632 | http://twiki.org | TWiki | me | dodo | 
    633 INPUT 
    634     my $query = new Unit::Request( 
    635         { 
    636             etedit    => ['on'], 
    637             ettablenr => ['1'], 
    638         } 
    639     ); 
    640  
    641     $query->path_info("/$webName/$topicName"); 
    642  
    643     my $twiki = new TWiki( undef, $query ); 
    644     $TWiki::Plugins::SESSION = $twiki; 
     632| http://twiki.org | Foswiki | me | dodo | 
     633INPUT 
     634    my $query = new Unit::Request( 
     635        { 
     636            etedit    => ['on'], 
     637            ettablenr => ['1'], 
     638        } 
     639    ); 
     640 
     641    $query->path_info("/$webName/$topicName"); 
     642 
     643    my $twiki = new Foswiki( undef, $query ); 
     644    $Foswiki::Plugins::SESSION = $twiki; 
    645645 
    646646    $query = new Unit::Request( 
     
    653653    $query->path_info("/$webName/$topicName"); 
    654654 
    655     TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
     655    Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
    656656        $input ); 
    657657 
    658     $twiki = new TWiki( undef, $query ); 
     658    $twiki = new Foswiki( undef, $query ); 
    659659        my $response = new Unit::Response; 
    660     $TWiki::Plugins::SESSION = $twiki; 
     660    $Foswiki::Plugins::SESSION = $twiki; 
    661661 
    662662    my ( $saveResult, $ecode ) = $this->capture( 
    663663        sub { 
    664             $response->body( TWiki::Func::expandCommonVariables( $input, 
     664            $response->body( Foswiki::Func::expandCommonVariables( $input, 
    665665                $this->{test_topic}, $this->{test_web}, undef ) ); 
    666666        } 
    667667    ); 
    668668 
    669     my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName ); 
     669    my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 
    670670 
    671671    my $expected = <<NEWEXPECTED; 
    672672%EDITTABLE{}% 
    673673| *URL* | *Name* | *By* | *Comment* | 
    674 | http://twiki.org | TWiki | me | dodo | 
     674| http://twiki.org | Foswiki | me | dodo | 
    675675NEWEXPECTED 
    676676    $this->assert_str_equals( $expected, $newtext, 0 ); 
     
    685685    my $webName   = $this->{test_web}; 
    686686    my $viewUrlAuth = 
    687       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    688     my $pubUrlSystemWeb = 
    689       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     687      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     688    my $pubUrlSystemWeb = 
     689      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    690690 
    691691    my $input = <<INPUT; 
     
    707707    $query->path_info("/$webName/$topicName"); 
    708708 
    709     my $twiki = new TWiki( undef, $query ); 
    710     $TWiki::Plugins::SESSION = $twiki; 
     709    my $twiki = new Foswiki( undef, $query ); 
     710    $Foswiki::Plugins::SESSION = $twiki; 
    711711 
    712712    $query = new Unit::Request( 
     
    720720    $query->path_info("/$webName/$topicName"); 
    721721 
    722     TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
     722    Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
    723723        $input ); 
    724724 
    725     $twiki = new TWiki( undef, $query ); 
     725    $twiki = new Foswiki( undef, $query ); 
    726726        my $response = new Unit::Response; 
    727     $TWiki::Plugins::SESSION = $twiki; 
     727    $Foswiki::Plugins::SESSION = $twiki; 
    728728 
    729729    my ( $saveResult, $ecode ) = $this->capture( 
    730730        sub { 
    731             $response->body( TWiki::Func::expandCommonVariables( $input, 
     731            $response->body( Foswiki::Func::expandCommonVariables( $input, 
    732732                $this->{test_topic}, $this->{test_web}, undef ) ); 
    733733        } 
    734734    ); 
    735735 
    736     my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName ); 
     736    my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 
    737737 
    738738    my $expected = <<NEWEXPECTED; 
     
    762762    my $webName   = $this->{test_web}; 
    763763    my $viewUrlAuth = 
    764       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    765     my $pubUrlSystemWeb = 
    766       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     764      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     765    my $pubUrlSystemWeb = 
     766      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    767767    my $input = <<INPUT; 
    768768%EDITTABLE{format="|text,40|text,10|"}%  
     
    778778    ); 
    779779    $query->path_info("/$webName/$topicName"); 
    780     my $twiki = new TWiki( undef, $query ); 
    781     $TWiki::Plugins::SESSION = $twiki; 
     780    my $twiki = new Foswiki( undef, $query ); 
     781    $Foswiki::Plugins::SESSION = $twiki; 
    782782    $query = new Unit::Request( 
    783783        { 
     
    787787    ); 
    788788    $query->path_info("/$webName/$topicName"); 
    789     TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
     789    Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
    790790        $input ); 
    791     $twiki = new TWiki( undef, $query ); 
     791    $twiki = new Foswiki( undef, $query ); 
    792792        my $response = new Unit::Response; 
    793     $TWiki::Plugins::SESSION = $twiki; 
     793    $Foswiki::Plugins::SESSION = $twiki; 
    794794    my ( $saveResult, $ecode ) = $this->capture( 
    795795        sub { 
    796             $response->body(TWiki::Func::expandCommonVariables( $input, 
     796            $response->body(Foswiki::Func::expandCommonVariables( $input, 
    797797                $this->{test_topic}, $this->{test_web}, undef ) ); 
    798798        } 
    799799    ); 
    800     my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName ); 
     800    my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 
    801801    my $expected = <<NEWEXPECTED; 
    802802%EDITTABLE{format="|text,40|text,10|"}%  
     
    820820    my $webName   = $this->{test_web}; 
    821821    my $viewUrlAuth = 
    822       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    823     my $pubUrlSystemWeb = 
    824       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     822      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     823    my $pubUrlSystemWeb = 
     824      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    825825    my $input = <<INPUT; 
    826826%EDITTABLE{format="|text,40|date,10,,%d %b %Y|date,10,,%d %b %Y|date,10,,%d %b %Y|"}%  
     
    837837    ); 
    838838    $query->path_info("/$webName/$topicName"); 
    839     my $twiki = new TWiki( undef, $query ); 
    840     $TWiki::Plugins::SESSION = $twiki; 
     839    my $twiki = new Foswiki( undef, $query ); 
     840    $Foswiki::Plugins::SESSION = $twiki; 
    841841    $query = new Unit::Request( 
    842842        { 
     
    846846    ); 
    847847    $query->path_info("/$webName/$topicName"); 
    848     TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
     848    Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
    849849        $input ); 
    850     $twiki = new TWiki( undef, $query ); 
     850    $twiki = new Foswiki( undef, $query ); 
    851851        my $response = new Unit::Response; 
    852     $TWiki::Plugins::SESSION = $twiki; 
     852    $Foswiki::Plugins::SESSION = $twiki; 
    853853    my ( $saveResult, $ecode ) = $this->capture( 
    854854        sub { 
    855             $response->body(TWiki::Func::expandCommonVariables( $input, 
     855            $response->body(Foswiki::Func::expandCommonVariables( $input, 
    856856                $this->{test_topic}, $this->{test_web}, undef ) ); 
    857857        } 
    858858    ); 
    859     my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName ); 
     859    my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 
    860860    my $expected = <<NEWEXPECTED; 
    861861%EDITTABLE{format="|text,40|date,10,,%d %b %Y|date,10,,%d %b %Y|date,10,,%d %b %Y|"}%  
     
    883883    my $webName   = $this->{test_web}; 
    884884    my $viewUrlAuth = 
    885       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    886     my $pubUrlSystemWeb = 
    887       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     885      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     886    my $pubUrlSystemWeb = 
     887      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    888888    my $input = <<INPUT; 
    889889%EDITTABLE{format="|text,40|text,10|"}%  
     
    898898    ); 
    899899    $query->path_info("/$webName/$topicName"); 
    900     my $twiki = new TWiki( undef, $query ); 
    901     $TWiki::Plugins::SESSION = $twiki; 
     900    my $twiki = new Foswiki( undef, $query ); 
     901    $Foswiki::Plugins::SESSION = $twiki; 
    902902    $query = new Unit::Request( 
    903903        { 
     
    907907    ); 
    908908    $query->path_info("/$webName/$topicName"); 
    909     TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
     909    Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
    910910        $input ); 
    911     $twiki = new TWiki( undef, $query ); 
     911    $twiki = new Foswiki( undef, $query ); 
    912912        my $response = new Unit::Response; 
    913     $TWiki::Plugins::SESSION = $twiki; 
     913    $Foswiki::Plugins::SESSION = $twiki; 
    914914    my ( $saveResult, $ecode ) = $this->capture( 
    915915        sub { 
    916             $response->body(TWiki::Func::expandCommonVariables( $input, 
     916            $response->body(Foswiki::Func::expandCommonVariables( $input, 
    917917                $this->{test_topic}, $this->{test_web}, undef ) ); 
    918918        } 
    919919    ); 
    920     my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName ); 
     920    my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 
    921921    my $expected = <<NEWEXPECTED; 
    922922%EDITTABLE{format="|text,40|text,10|"}%  
     
    939939    my $webName   = $this->{test_web}; 
    940940    my $viewUrlAuth = 
    941       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    942     my $pubUrlSystemWeb = 
    943       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     941      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     942    my $pubUrlSystemWeb = 
     943      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    944944 
    945945    my $input = <<INPUT; 
     
    949949 
    950950    my $result = 
    951       TWiki::Func::expandCommonVariables( $input, $topicName, 
     951      Foswiki::Func::expandCommonVariables( $input, $topicName, 
    952952        $webName, undef ); 
    953953         
     
    978978    my $webName   = $this->{test_web}; 
    979979    my $viewUrlAuth = 
    980       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    981     my $pubUrlSystemWeb = 
    982       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     980      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     981    my $pubUrlSystemWeb = 
     982      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    983983    my $input = <<INPUT; 
    984984%EDITTABLE{}% 
     
    992992    ); 
    993993    $query->path_info("/$webName/$topicName"); 
    994     my $twiki = new TWiki( undef, $query ); 
    995     $TWiki::Plugins::SESSION = $twiki; 
     994    my $twiki = new Foswiki( undef, $query ); 
     995    $Foswiki::Plugins::SESSION = $twiki; 
    996996    $query = new Unit::Request( 
    997997        { 
     
    10011001    ); 
    10021002    $query->path_info("/$webName/$topicName"); 
    1003     TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
     1003    Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
    10041004        $input ); 
    1005     $twiki = new TWiki( undef, $query ); 
     1005    $twiki = new Foswiki( undef, $query ); 
    10061006        my $response = new Unit::Response; 
    1007     $TWiki::Plugins::SESSION = $twiki; 
     1007    $Foswiki::Plugins::SESSION = $twiki; 
    10081008    my ( $saveResult, $ecode ) = $this->capture( 
    10091009        sub { 
    1010             $response->body(TWiki::Func::expandCommonVariables( $input, 
     1010            $response->body(Foswiki::Func::expandCommonVariables( $input, 
    10111011                $this->{test_topic}, $this->{test_web}, undef ) ); 
    10121012        } 
    10131013    ); 
    1014     my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName ); 
     1014    my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 
    10151015    my $expected = <<NEWEXPECTED; 
    10161016%EDITTABLE{}% 
     
    10321032    my $webName   = $this->{test_web}; 
    10331033    my $viewUrlAuth = 
    1034       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    1035     my $pubUrlSystemWeb = 
    1036       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     1034      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     1035    my $pubUrlSystemWeb = 
     1036      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    10371037    my $input = <<INPUT; 
    10381038%EDITTABLE{ changerows="off" quietsave="off"  }% 
     
    10461046    ); 
    10471047    $query->path_info("/$webName/$topicName"); 
    1048     my $twiki = new TWiki( undef, $query ); 
    1049     $TWiki::Plugins::SESSION = $twiki; 
     1048    my $twiki = new Foswiki( undef, $query ); 
     1049    $Foswiki::Plugins::SESSION = $twiki; 
    10501050    $query = new Unit::Request( 
    10511051        { 
     
    10551055    ); 
    10561056    $query->path_info("/$webName/$topicName"); 
    1057     TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
     1057    Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
    10581058        $input ); 
    1059     $twiki = new TWiki( undef, $query ); 
     1059    $twiki = new Foswiki( undef, $query ); 
    10601060        my $response = new Unit::Response; 
    1061     $TWiki::Plugins::SESSION = $twiki; 
     1061    $Foswiki::Plugins::SESSION = $twiki; 
    10621062    my ( $saveResult, $ecode ) = $this->capture( 
    10631063        sub { 
    1064             $response->body(TWiki::Func::expandCommonVariables( $input, 
     1064            $response->body(Foswiki::Func::expandCommonVariables( $input, 
    10651065                $this->{test_topic}, $this->{test_web}, undef ) ); 
    10661066        } 
    10671067    ); 
    1068     my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName ); 
     1068    my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 
    10691069    my $expected = <<NEWEXPECTED; 
    10701070%EDITTABLE{ changerows="off" quietsave="off"  }% 
     
    10851085    my $webName   = $this->{test_web}; 
    10861086    my $viewUrlAuth = 
    1087       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    1088     my $pubUrlSystemWeb = 
    1089       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     1087      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     1088    my $pubUrlSystemWeb = 
     1089      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    10901090 
    10911091    $this->{twiki}->{store} 
     
    11151115    my $webName   = $this->{test_web}; 
    11161116    my $viewUrlAuth = 
    1117       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    1118     my $pubUrlSystemWeb = 
    1119       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     1117      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     1118    my $pubUrlSystemWeb = 
     1119      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    11201120 
    11211121    my $query = new Unit::Request( 
     
    11321132        $query->path_info("/$webName/$topicName"); 
    11331133 
    1134     my $twiki = new TWiki( undef, $query ); 
    1135     $TWiki::Plugins::SESSION = $twiki; 
     1134    my $twiki = new Foswiki( undef, $query ); 
     1135    $Foswiki::Plugins::SESSION = $twiki; 
    11361136    my $result = 
    1137       TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
     1137      Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 
    11381138 
    11391139    my $expected = <<EXPECTED; 
     
    11641164    my $webName   = $this->{test_web}; 
    11651165    my $viewUrlAuth = 
    1166       TWiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
    1167     my $pubUrlSystemWeb = 
    1168       TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName}; 
     1166      Foswiki::Func::getScriptUrl( $webName, $topicName, 'viewauth' ); 
     1167    my $pubUrlSystemWeb = 
     1168      Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 
    11691169 
    11701170    my $input = <<INPUT; 
     
    11821182    $query->path_info("/$webName/$topicName"); 
    11831183 
    1184     my $twiki = new TWiki( undef, $query ); 
    1185     $TWiki::Plugins::SESSION = $twiki; 
     1184    my $twiki = new Foswiki( undef, $query ); 
     1185    $Foswiki::Plugins::SESSION = $twiki; 
    11861186 
    11871187    $query = new Unit::Request( 
     
    11941194    $query->path_info("/$webName/$topicName"); 
    11951195 
    1196     TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
     1196    Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 
    11971197        $input ); 
    11981198 
    1199     $twiki = new TWiki( undef, $query ); 
     1199    $twiki = new Foswiki( undef, $query ); 
    12001200        my $response = new Unit::Response; 
    1201     $TWiki::Plugins::SESSION = $twiki; 
     1201    $Foswiki::Plugins::SESSION = $twiki; 
    12021202 
    12031203    my ( $saveResult, $ecode ) = $this->capture( 
    12041204        sub { 
    1205             $response->body( TWiki::Func::expandCommonVariables( $input, 
     1205            $response->body( Foswiki::Func::expandCommonVariables( $input, 
    12061206                $this->{test_topic}, $this->{test_web}, undef ) ); 
    12071207        } 
    12081208    ); 
    12091209 
    1210     my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName ); 
     1210    my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 
    12111211 
    12121212    my $expected = <<NEWEXPECTED; 
Note: See TracChangeset for help on using the changeset viewer.