Changeset 1030
- Timestamp:
- 11/28/08 01:46:53 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EditTablePlugin/test/unit/EditTablePlugin/EditTablePluginTests.pm
r777 r1030 5 5 package EditTablePluginTests; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 9 use strict; 10 use TWiki::UI::Save;10 use Foswiki::UI::Save; 11 11 use Error qw( :try ); 12 use TWiki::Plugins::EditTablePlugin;13 use TWiki::Plugins::EditTablePlugin::Core;12 use Foswiki::Plugins::EditTablePlugin; 13 use Foswiki::Plugins::EditTablePlugin::Core; 14 14 15 15 sub new { … … 24 24 25 25 # $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"'; 29 29 30 30 $ENV{SCRIPT_NAME} = ''; # required by fake sort URLs in expected text … … 41 41 if ($doRender) { 42 42 $actual = 43 TWiki::Func::expandCommonVariables( $actual, $webName, $topicName );43 Foswiki::Func::expandCommonVariables( $actual, $webName, $topicName ); 44 44 $actual = 45 45 $session->renderer->getRenderedVersion( $actual, $webName, … … 69 69 my $webName = $this->{test_web}; 70 70 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}; 74 74 75 75 $this->{twiki}->{store} … … 103 103 my $webName = $this->{test_web}; 104 104 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}; 108 108 109 109 $this->{twiki}->{store} … … 138 138 my $webName = $this->{test_web}; 139 139 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}; 143 143 144 144 my $query = new Unit::Request( … … 154 154 155 155 my $result = 156 TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef );156 Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 157 157 158 158 my $expected = <<EXPECTED; … … 181 181 my $webName = $this->{test_web}; 182 182 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}; 185 185 186 186 my $input = <<INPUT; … … 197 197 $query->path_info("/$webName/$topicName"); 198 198 199 my $twiki = new TWiki( undef, $query );200 $ TWiki::Plugins::SESSION = $twiki;199 my $twiki = new Foswiki( undef, $query ); 200 $Foswiki::Plugins::SESSION = $twiki; 201 201 202 202 my $result = 203 TWiki::Func::expandCommonVariables( $input, $this->{test_topic},203 Foswiki::Func::expandCommonVariables( $input, $this->{test_topic}, 204 204 $this->{test_web}, undef ); 205 205 … … 230 230 my $webName = $this->{test_web}; 231 231 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}; 235 235 236 236 my $input = <<INPUT; … … 248 248 $query->path_info("/$webName/$topicName"); 249 249 250 my $twiki = new TWiki( undef, $query );251 $ TWiki::Plugins::SESSION = $twiki;250 my $twiki = new Foswiki( undef, $query ); 251 $Foswiki::Plugins::SESSION = $twiki; 252 252 253 253 my $result = 254 TWiki::Func::expandCommonVariables( $input, $this->{test_topic},254 Foswiki::Func::expandCommonVariables( $input, $this->{test_topic}, 255 255 $this->{test_web}, undef ); 256 256 … … 289 289 $query->path_info("/$webName/$topicName"); 290 290 291 $twiki = new TWiki( undef, $query );292 $ TWiki::Plugins::SESSION = $twiki;291 $twiki = new Foswiki( undef, $query ); 292 $Foswiki::Plugins::SESSION = $twiki; 293 293 294 294 $result = 295 TWiki::Func::expandCommonVariables( $input, $this->{test_topic},295 Foswiki::Func::expandCommonVariables( $input, $this->{test_topic}, 296 296 $this->{test_web}, undef ); 297 297 … … 350 350 $query->path_info("/$webName/$topicName"); 351 351 352 TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef,352 Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 353 353 $input ); 354 354 355 $twiki = new TWiki( undef, $query );355 $twiki = new Foswiki( undef, $query ); 356 356 my $response = new Unit::Response; 357 $ TWiki::Plugins::SESSION = $twiki;357 $Foswiki::Plugins::SESSION = $twiki; 358 358 359 359 my ( $saveResult, $ecode ) = $this->capture( 360 360 sub { 361 $response->body( TWiki::Func::expandCommonVariables( $input,361 $response->body(Foswiki::Func::expandCommonVariables( $input, 362 362 $this->{test_topic}, $this->{test_web}, undef ) ); 363 363 } … … 365 365 $this->assert( $saveResult =~ /Status: 302/ ); 366 366 367 my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName );367 my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 368 368 369 369 $expected = <<NEWEXPECTED; … … 391 391 my $webName = $this->{test_web}; 392 392 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}; 396 396 397 397 my $query = new Unit::Request( … … 408 408 INPUT 409 409 410 my $twiki = new TWiki( undef, $query );411 $ TWiki::Plugins::SESSION = $twiki;410 my $twiki = new Foswiki( undef, $query ); 411 $Foswiki::Plugins::SESSION = $twiki; 412 412 my $result = 413 TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef );413 Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 414 414 415 415 my $expected = <<END; … … 456 456 my $webName = $this->{test_web}; 457 457 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}; 460 460 461 461 my $query = new Unit::Request( … … 471 471 INPUT 472 472 473 my $twiki = new TWiki( undef, $query );474 $ TWiki::Plugins::SESSION = $twiki;473 my $twiki = new Foswiki( undef, $query ); 474 $Foswiki::Plugins::SESSION = $twiki; 475 475 my $result = 476 TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef );476 Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 477 477 478 478 my $expected = <<END; … … 518 518 my $webName = $this->{test_web}; 519 519 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() 522 522 . "/view/$webName/$topicName" 523 523 ; # heck, how can I do this otherwise? I need the relative path 524 524 my $pubUrlSystemWeb = 525 TWiki::Func::getUrlHost() . TWiki::Func::getPubUrlPath() . '/' . $TWiki::cfg{SystemWebName};525 Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath() . '/' . $Foswiki::cfg{SystemWebName}; 526 526 527 527 my $text = <<INPUT; … … 531 531 532 532 my $result = 533 TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef );533 Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 534 534 535 535 my $expected = <<END; … … 553 553 END 554 554 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; 557 557 558 558 $this->do_testHtmlOutput( $expected, $result, 1 ); … … 565 565 my $webName = $this->{test_web}; 566 566 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}; 570 570 my $userName = $this->{users_web} . '.' . 'WikiGuest'; 571 571 … … 582 582 $query->path_info("/$webName/$topicName"); 583 583 584 my $twiki = new TWiki( undef, $query );585 $ TWiki::Plugins::SESSION = $twiki;584 my $twiki = new Foswiki( undef, $query ); 585 $Foswiki::Plugins::SESSION = $twiki; 586 586 my $result = 587 TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef );587 Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 588 588 589 589 my $expected = <<END; … … 623 623 my $webName = $this->{test_web}; 624 624 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}; 628 628 629 629 my $input = <<INPUT; 630 630 %EDITTABLE{}% 631 631 | *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 | 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 Foswiki( undef, $query ); 644 $Foswiki::Plugins::SESSION = $twiki; 645 645 646 646 $query = new Unit::Request( … … 653 653 $query->path_info("/$webName/$topicName"); 654 654 655 TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef,655 Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 656 656 $input ); 657 657 658 $twiki = new TWiki( undef, $query );658 $twiki = new Foswiki( undef, $query ); 659 659 my $response = new Unit::Response; 660 $ TWiki::Plugins::SESSION = $twiki;660 $Foswiki::Plugins::SESSION = $twiki; 661 661 662 662 my ( $saveResult, $ecode ) = $this->capture( 663 663 sub { 664 $response->body( TWiki::Func::expandCommonVariables( $input,664 $response->body( Foswiki::Func::expandCommonVariables( $input, 665 665 $this->{test_topic}, $this->{test_web}, undef ) ); 666 666 } 667 667 ); 668 668 669 my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName );669 my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 670 670 671 671 my $expected = <<NEWEXPECTED; 672 672 %EDITTABLE{}% 673 673 | *URL* | *Name* | *By* | *Comment* | 674 | http://twiki.org | TWiki | me | dodo |674 | http://twiki.org | Foswiki | me | dodo | 675 675 NEWEXPECTED 676 676 $this->assert_str_equals( $expected, $newtext, 0 ); … … 685 685 my $webName = $this->{test_web}; 686 686 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}; 690 690 691 691 my $input = <<INPUT; … … 707 707 $query->path_info("/$webName/$topicName"); 708 708 709 my $twiki = new TWiki( undef, $query );710 $ TWiki::Plugins::SESSION = $twiki;709 my $twiki = new Foswiki( undef, $query ); 710 $Foswiki::Plugins::SESSION = $twiki; 711 711 712 712 $query = new Unit::Request( … … 720 720 $query->path_info("/$webName/$topicName"); 721 721 722 TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef,722 Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 723 723 $input ); 724 724 725 $twiki = new TWiki( undef, $query );725 $twiki = new Foswiki( undef, $query ); 726 726 my $response = new Unit::Response; 727 $ TWiki::Plugins::SESSION = $twiki;727 $Foswiki::Plugins::SESSION = $twiki; 728 728 729 729 my ( $saveResult, $ecode ) = $this->capture( 730 730 sub { 731 $response->body( TWiki::Func::expandCommonVariables( $input,731 $response->body( Foswiki::Func::expandCommonVariables( $input, 732 732 $this->{test_topic}, $this->{test_web}, undef ) ); 733 733 } 734 734 ); 735 735 736 my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName );736 my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 737 737 738 738 my $expected = <<NEWEXPECTED; … … 762 762 my $webName = $this->{test_web}; 763 763 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}; 767 767 my $input = <<INPUT; 768 768 %EDITTABLE{format="|text,40|text,10|"}% … … 778 778 ); 779 779 $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; 782 782 $query = new Unit::Request( 783 783 { … … 787 787 ); 788 788 $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, 790 790 $input ); 791 $twiki = new TWiki( undef, $query );791 $twiki = new Foswiki( undef, $query ); 792 792 my $response = new Unit::Response; 793 $ TWiki::Plugins::SESSION = $twiki;793 $Foswiki::Plugins::SESSION = $twiki; 794 794 my ( $saveResult, $ecode ) = $this->capture( 795 795 sub { 796 $response->body( TWiki::Func::expandCommonVariables( $input,796 $response->body(Foswiki::Func::expandCommonVariables( $input, 797 797 $this->{test_topic}, $this->{test_web}, undef ) ); 798 798 } 799 799 ); 800 my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName );800 my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 801 801 my $expected = <<NEWEXPECTED; 802 802 %EDITTABLE{format="|text,40|text,10|"}% … … 820 820 my $webName = $this->{test_web}; 821 821 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}; 825 825 my $input = <<INPUT; 826 826 %EDITTABLE{format="|text,40|date,10,,%d %b %Y|date,10,,%d %b %Y|date,10,,%d %b %Y|"}% … … 837 837 ); 838 838 $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; 841 841 $query = new Unit::Request( 842 842 { … … 846 846 ); 847 847 $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, 849 849 $input ); 850 $twiki = new TWiki( undef, $query );850 $twiki = new Foswiki( undef, $query ); 851 851 my $response = new Unit::Response; 852 $ TWiki::Plugins::SESSION = $twiki;852 $Foswiki::Plugins::SESSION = $twiki; 853 853 my ( $saveResult, $ecode ) = $this->capture( 854 854 sub { 855 $response->body( TWiki::Func::expandCommonVariables( $input,855 $response->body(Foswiki::Func::expandCommonVariables( $input, 856 856 $this->{test_topic}, $this->{test_web}, undef ) ); 857 857 } 858 858 ); 859 my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName );859 my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 860 860 my $expected = <<NEWEXPECTED; 861 861 %EDITTABLE{format="|text,40|date,10,,%d %b %Y|date,10,,%d %b %Y|date,10,,%d %b %Y|"}% … … 883 883 my $webName = $this->{test_web}; 884 884 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}; 888 888 my $input = <<INPUT; 889 889 %EDITTABLE{format="|text,40|text,10|"}% … … 898 898 ); 899 899 $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; 902 902 $query = new Unit::Request( 903 903 { … … 907 907 ); 908 908 $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, 910 910 $input ); 911 $twiki = new TWiki( undef, $query );911 $twiki = new Foswiki( undef, $query ); 912 912 my $response = new Unit::Response; 913 $ TWiki::Plugins::SESSION = $twiki;913 $Foswiki::Plugins::SESSION = $twiki; 914 914 my ( $saveResult, $ecode ) = $this->capture( 915 915 sub { 916 $response->body( TWiki::Func::expandCommonVariables( $input,916 $response->body(Foswiki::Func::expandCommonVariables( $input, 917 917 $this->{test_topic}, $this->{test_web}, undef ) ); 918 918 } 919 919 ); 920 my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName );920 my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 921 921 my $expected = <<NEWEXPECTED; 922 922 %EDITTABLE{format="|text,40|text,10|"}% … … 939 939 my $webName = $this->{test_web}; 940 940 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}; 944 944 945 945 my $input = <<INPUT; … … 949 949 950 950 my $result = 951 TWiki::Func::expandCommonVariables( $input, $topicName,951 Foswiki::Func::expandCommonVariables( $input, $topicName, 952 952 $webName, undef ); 953 953 … … 978 978 my $webName = $this->{test_web}; 979 979 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}; 983 983 my $input = <<INPUT; 984 984 %EDITTABLE{}% … … 992 992 ); 993 993 $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; 996 996 $query = new Unit::Request( 997 997 { … … 1001 1001 ); 1002 1002 $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, 1004 1004 $input ); 1005 $twiki = new TWiki( undef, $query );1005 $twiki = new Foswiki( undef, $query ); 1006 1006 my $response = new Unit::Response; 1007 $ TWiki::Plugins::SESSION = $twiki;1007 $Foswiki::Plugins::SESSION = $twiki; 1008 1008 my ( $saveResult, $ecode ) = $this->capture( 1009 1009 sub { 1010 $response->body( TWiki::Func::expandCommonVariables( $input,1010 $response->body(Foswiki::Func::expandCommonVariables( $input, 1011 1011 $this->{test_topic}, $this->{test_web}, undef ) ); 1012 1012 } 1013 1013 ); 1014 my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName );1014 my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 1015 1015 my $expected = <<NEWEXPECTED; 1016 1016 %EDITTABLE{}% … … 1032 1032 my $webName = $this->{test_web}; 1033 1033 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}; 1037 1037 my $input = <<INPUT; 1038 1038 %EDITTABLE{ changerows="off" quietsave="off" }% … … 1046 1046 ); 1047 1047 $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; 1050 1050 $query = new Unit::Request( 1051 1051 { … … 1055 1055 ); 1056 1056 $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, 1058 1058 $input ); 1059 $twiki = new TWiki( undef, $query );1059 $twiki = new Foswiki( undef, $query ); 1060 1060 my $response = new Unit::Response; 1061 $ TWiki::Plugins::SESSION = $twiki;1061 $Foswiki::Plugins::SESSION = $twiki; 1062 1062 my ( $saveResult, $ecode ) = $this->capture( 1063 1063 sub { 1064 $response->body( TWiki::Func::expandCommonVariables( $input,1064 $response->body(Foswiki::Func::expandCommonVariables( $input, 1065 1065 $this->{test_topic}, $this->{test_web}, undef ) ); 1066 1066 } 1067 1067 ); 1068 my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName );1068 my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 1069 1069 my $expected = <<NEWEXPECTED; 1070 1070 %EDITTABLE{ changerows="off" quietsave="off" }% … … 1085 1085 my $webName = $this->{test_web}; 1086 1086 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}; 1090 1090 1091 1091 $this->{twiki}->{store} … … 1115 1115 my $webName = $this->{test_web}; 1116 1116 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}; 1120 1120 1121 1121 my $query = new Unit::Request( … … 1132 1132 $query->path_info("/$webName/$topicName"); 1133 1133 1134 my $twiki = new TWiki( undef, $query );1135 $ TWiki::Plugins::SESSION = $twiki;1134 my $twiki = new Foswiki( undef, $query ); 1135 $Foswiki::Plugins::SESSION = $twiki; 1136 1136 my $result = 1137 TWiki::Func::expandCommonVariables( $text, $topicName, $webName, undef );1137 Foswiki::Func::expandCommonVariables( $text, $topicName, $webName, undef ); 1138 1138 1139 1139 my $expected = <<EXPECTED; … … 1164 1164 my $webName = $this->{test_web}; 1165 1165 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}; 1169 1169 1170 1170 my $input = <<INPUT; … … 1182 1182 $query->path_info("/$webName/$topicName"); 1183 1183 1184 my $twiki = new TWiki( undef, $query );1185 $ TWiki::Plugins::SESSION = $twiki;1184 my $twiki = new Foswiki( undef, $query ); 1185 $Foswiki::Plugins::SESSION = $twiki; 1186 1186 1187 1187 $query = new Unit::Request( … … 1194 1194 $query->path_info("/$webName/$topicName"); 1195 1195 1196 TWiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef,1196 Foswiki::Func::saveTopic( $this->{test_web}, $this->{test_topic}, undef, 1197 1197 $input ); 1198 1198 1199 $twiki = new TWiki( undef, $query );1199 $twiki = new Foswiki( undef, $query ); 1200 1200 my $response = new Unit::Response; 1201 $ TWiki::Plugins::SESSION = $twiki;1201 $Foswiki::Plugins::SESSION = $twiki; 1202 1202 1203 1203 my ( $saveResult, $ecode ) = $this->capture( 1204 1204 sub { 1205 $response->body( TWiki::Func::expandCommonVariables( $input,1205 $response->body( Foswiki::Func::expandCommonVariables( $input, 1206 1206 $this->{test_topic}, $this->{test_web}, undef ) ); 1207 1207 } 1208 1208 ); 1209 1209 1210 my ( $meta, $newtext ) = TWiki::Func::readTopic( $webName, $topicName );1210 my ( $meta, $newtext ) = Foswiki::Func::readTopic( $webName, $topicName ); 1211 1211 1212 1212 my $expected = <<NEWEXPECTED;
Note: See TracChangeset
for help on using the changeset viewer.
