Changeset 816 for trunk/UnitTestContrib/test/unit/Fn_IF.pm
- Timestamp:
- 11/19/08 19:11:33 (4 years ago)
- File:
-
- 1 edited
-
trunk/UnitTestContrib/test/unit/Fn_IF.pm (modified) (55 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/test/unit/Fn_IF.pm
r664 r816 5 5 package Fn_IF; 6 6 7 use base qw( TWikiFnTestCase );8 9 use TWiki;7 use base qw( FoswikiFnTestCase ); 8 9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 59 59 $this->simpleTest( 60 60 test => '$ WIKINAME = \'' 61 . TWiki::Func::getWikiName( $this->{twiki}->{user} ) . "'",61 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) . "'", 62 62 then => 1, 63 63 else => 0 … … 69 69 $this->simpleTest( 70 70 test => '$ \'WIKINAME\' = \'' 71 . TWiki::Func::getWikiName( $this->{twiki}->{user} ) . "'",71 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) . "'", 72 72 then => 1, 73 73 else => 0 … … 191 191 my $this = shift; 192 192 $this->simpleTest( 193 test => "\$PUBURLPATH='" . $ TWiki::cfg{PubUrlPath} . "'",193 test => "\$PUBURLPATH='" . $Foswiki::cfg{PubUrlPath} . "'", 194 194 then => 1, 195 195 else => 0 … … 200 200 my $this = shift; 201 201 $this->simpleTest( 202 test => "\$'PUBURLPATH'='" . $ TWiki::cfg{PubUrlPath} . "'",202 test => "\$'PUBURLPATH'='" . $Foswiki::cfg{PubUrlPath} . "'", 203 203 then => 1, 204 204 else => 0 … … 235 235 $this->simpleTest( 236 236 test => "d2n('2007-03-26')=" 237 . TWiki::Time::parseTime( '2007-03-26', 1 ),237 . Foswiki::Time::parseTime( '2007-03-26', 1 ), 238 238 then => 1, 239 239 else => 0 … … 280 280 $this->simpleTest( 281 281 test => "'" 282 . TWiki::Func::getWikiName( $this->{twiki}->{user} )282 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 283 283 . "' ingroup 'WikiGuest'", 284 284 then => 0, … … 291 291 $this->simpleTest( 292 292 test => "'" 293 . TWiki::Func::wikiToUserName(294 TWiki::Func::getWikiName( $this->{twiki}->{user} )293 . Foswiki::Func::wikiToUserName( 294 Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 295 295 ) 296 296 . "' ingroup 'WikiGuest'", … … 314 314 $this->simpleTest( 315 315 test => "'" 316 . TWiki::Func::getWikiName( $this->{twiki}->{user} )316 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 317 317 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 318 318 then => 0, … … 325 325 $this->simpleTest( 326 326 test => "'" 327 . TWiki::Func::wikiToUserName(328 TWiki::Func::getWikiName( $this->{twiki}->{user} )327 . Foswiki::Func::wikiToUserName( 328 Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 329 329 ) 330 330 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", … … 350 350 $this->simpleTest( 351 351 test => "'" 352 . TWiki::Func::wikiToUserName(353 TWiki::Func::getWikiName( $this->{twiki}->{user} )352 . Foswiki::Func::wikiToUserName( 353 Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 354 354 ) 355 . "' ingroup '$ TWiki::cfg{SuperAdminGroup}'",355 . "' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 356 356 then => 0, 357 357 else => 1 … … 363 363 $this->simpleTest( 364 364 test => "'" 365 . TWiki::Func::getWikiName( $this->{twiki}->{user} )366 . "' ingroup '$ TWiki::cfg{SuperAdminGroup}'",365 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 366 . "' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 367 367 then => 0, 368 368 else => 1 … … 375 375 test => "'" 376 376 . $this->{twiki}->{user} 377 . "' ingroup '$ TWiki::cfg{SuperAdminGroup}'",377 . "' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 378 378 then => 0, 379 379 else => 1 … … 386 386 $this->simpleTest( 387 387 test => "'" 388 . TWiki::Func::wikiToUserName(389 TWiki::Func::getWikiName( $this->{twiki}->{user} )388 . Foswiki::Func::wikiToUserName( 389 Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 390 390 ) 391 391 . "' ingroup 'GropeGroup'", … … 399 399 $this->simpleTest( 400 400 test => "'" 401 . TWiki::Func::getWikiName( $this->{twiki}->{user} )401 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 402 402 . "' ingroup 'GropeGroup'", 403 403 then => 1, … … 439 439 my $this = shift; 440 440 $this->simpleTest( 441 test => "'%USERNAME%' ingroup '$ TWiki::cfg{SuperAdminGroup}'",441 test => "'%USERNAME%' ingroup '$Foswiki::cfg{SuperAdminGroup}'", 442 442 then => 0, 443 443 else => 1 … … 477 477 $this->simpleTest( 478 478 test => "'%USERINFO{format=\"\$username\"}%' ingroup '" 479 . $ TWiki::cfg{SuperAdminGroup} . "'",479 . $Foswiki::cfg{SuperAdminGroup} . "'", 480 480 then => 0, 481 481 else => 1 … … 515 515 $this->simpleTest( 516 516 test => "'%USERINFO{format=\"\$wikiname\"}%' ingroup '" 517 . $ TWiki::cfg{SuperAdminGroup} . "'",517 . $Foswiki::cfg{SuperAdminGroup} . "'", 518 518 then => 0, 519 519 else => 1 … … 553 553 $this->simpleTest( 554 554 test => "'%USERINFO{format=\"\$wikiusername\"}%' ingroup '" 555 . $ TWiki::cfg{SuperAdminGroup} . "'",555 . $Foswiki::cfg{SuperAdminGroup} . "'", 556 556 then => 0, 557 557 else => 1 … … 572 572 $this->simpleTest( 573 573 test => "'" 574 . TWiki::Func::getWikiName( $this->{twiki}->{user} )574 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 575 575 . "' ingroup 'WikiGuest'", 576 576 then => 0, … … 583 583 $this->simpleTest( 584 584 test => "'" 585 . TWiki::Func::getWikiName( $this->{twiki}->{user} )585 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 586 586 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 587 587 then => 0, … … 594 594 $this->simpleTest( 595 595 test => "'" 596 . TWiki::Func::getWikiName( $this->{twiki}->{user} )596 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 597 597 . "' ingroup '" 598 . $ TWiki::cfg{SuperAdminGroup} . "'",598 . $Foswiki::cfg{SuperAdminGroup} . "'", 599 599 then => 0, 600 600 else => 1 … … 606 606 $this->simpleTest( 607 607 test => "'" 608 . TWiki::Func::getWikiName( $this->{twiki}->{user} )608 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) 609 609 . "' ingroup 'GropeGroup'", 610 610 then => 1, … … 616 616 my $this = shift; 617 617 $this->simpleTest( 618 test => "'" . $ TWiki::cfg{AdminUserWikiName} . "' ingroup 'WikiGuest'",618 test => "'" . $Foswiki::cfg{AdminUserWikiName} . "' ingroup 'WikiGuest'", 619 619 then => 0, 620 620 else => 1 … … 626 626 $this->simpleTest( 627 627 test => "'" 628 . $ TWiki::cfg{AdminUserWikiName}628 . $Foswiki::cfg{AdminUserWikiName} 629 629 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 630 630 then => 0, … … 637 637 $this->simpleTest( 638 638 test => "'" 639 . $ TWiki::cfg{AdminUserWikiName}639 . $Foswiki::cfg{AdminUserWikiName} 640 640 . "' ingroup '" 641 . $ TWiki::cfg{SuperAdminGroup} . "'",641 . $Foswiki::cfg{SuperAdminGroup} . "'", 642 642 then => 1, 643 643 else => 0 … … 648 648 my $this = shift; 649 649 $this->simpleTest( 650 test => "'" . $ TWiki::cfg{AdminUserWikiName} . "' ingroup 'GropeGroup'",650 test => "'" . $Foswiki::cfg{AdminUserWikiName} . "' ingroup 'GropeGroup'", 651 651 then => 0, 652 652 else => 1 … … 658 658 $this->simpleTest( 659 659 test => "'" 660 . $ TWiki::cfg{DefaultUserWikiName}660 . $Foswiki::cfg{DefaultUserWikiName} 661 661 . "' ingroup 'WikiGuest'", 662 662 then => 0, … … 669 669 $this->simpleTest( 670 670 test => "'" 671 . $ TWiki::cfg{DefaultUserWikiName}671 . $Foswiki::cfg{DefaultUserWikiName} 672 672 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 673 673 then => 0, … … 680 680 $this->simpleTest( 681 681 test => "'" 682 . $ TWiki::cfg{DefaultUserWikiName}682 . $Foswiki::cfg{DefaultUserWikiName} 683 683 . "' ingroup '" 684 . $ TWiki::cfg{SuperAdminGroup} . "'",684 . $Foswiki::cfg{SuperAdminGroup} . "'", 685 685 then => 0, 686 686 else => 1 … … 691 691 my $this = shift; 692 692 $this->simpleTest( 693 test => "'$ TWiki::cfg{DefaultUserWikiName}' ingroup 'GropeGroup'",693 test => "'$Foswiki::cfg{DefaultUserWikiName}' ingroup 'GropeGroup'", 694 694 then => 1, 695 695 else => 0 … … 700 700 my $this = shift; 701 701 $this->simpleTest( 702 test => "'" . $ TWiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'",702 test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'", 703 703 then => 0, 704 704 else => 1 … … 710 710 $this->simpleTest( 711 711 test => "'" 712 . $ TWiki::cfg{AdminUserLogin}712 . $Foswiki::cfg{AdminUserLogin} 713 713 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 714 714 then => 0, … … 721 721 $this->simpleTest( 722 722 test => "'" 723 . $ TWiki::cfg{AdminUserLogin}723 . $Foswiki::cfg{AdminUserLogin} 724 724 . "' ingroup '" 725 . $ TWiki::cfg{SuperAdminGroup} . "'",725 . $Foswiki::cfg{SuperAdminGroup} . "'", 726 726 then => 1, 727 727 else => 0 … … 732 732 my $this = shift; 733 733 $this->simpleTest( 734 test => "'" . $ TWiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'",734 test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'", 735 735 then => 0, 736 736 else => 1 … … 741 741 my $this = shift; 742 742 $this->simpleTest( 743 test => "'" . $ TWiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'",743 test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'", 744 744 then => 0, 745 745 else => 1 … … 751 751 $this->simpleTest( 752 752 test => "'" 753 . $ TWiki::cfg{DefaultUserLogin}753 . $Foswiki::cfg{DefaultUserLogin} 754 754 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 755 755 then => 0, … … 762 762 $this->simpleTest( 763 763 test => "'" 764 . $ TWiki::cfg{DefaultUserLogin}764 . $Foswiki::cfg{DefaultUserLogin} 765 765 . "' ingroup '" 766 . $ TWiki::cfg{SuperAdminGroup} . "'",766 . $Foswiki::cfg{SuperAdminGroup} . "'", 767 767 then => 0, 768 768 else => 1 … … 773 773 my $this = shift; 774 774 $this->simpleTest( 775 test => "'" . $ TWiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'",775 test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'", 776 776 then => 1, 777 777 else => 0 … … 782 782 my $this = shift; 783 783 $this->simpleTest( 784 test => "'" . $ TWiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'",784 test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'WikiGuest'", 785 785 then => 0, 786 786 else => 1 … … 792 792 $this->simpleTest( 793 793 test => "'" 794 . $ TWiki::cfg{AdminUserLogin}794 . $Foswiki::cfg{AdminUserLogin} 795 795 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 796 796 then => 0, … … 803 803 $this->simpleTest( 804 804 test => "'" 805 . $ TWiki::cfg{AdminUserLogin}805 . $Foswiki::cfg{AdminUserLogin} 806 806 . "' ingroup '" 807 . $ TWiki::cfg{SuperAdminGroup} . "'",807 . $Foswiki::cfg{SuperAdminGroup} . "'", 808 808 then => 1, 809 809 else => 0 … … 814 814 my $this = shift; 815 815 $this->simpleTest( 816 test => "'" . $ TWiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'",816 test => "'" . $Foswiki::cfg{AdminUserLogin} . "' ingroup 'GropeGroup'", 817 817 then => 0, 818 818 else => 1 … … 823 823 my $this = shift; 824 824 $this->simpleTest( 825 test => "'" . $ TWiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'",825 test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'WikiGuest'", 826 826 then => 0, 827 827 else => 1 … … 833 833 $this->simpleTest( 834 834 test => "'" 835 . $ TWiki::cfg{DefaultUserLogin}835 . $Foswiki::cfg{DefaultUserLogin} 836 836 . "' ingroup 'ThereHadBetterBeNoSuchGroup'", 837 837 then => 0, … … 844 844 $this->simpleTest( 845 845 test => "'" 846 . $ TWiki::cfg{DefaultUserLogin}846 . $Foswiki::cfg{DefaultUserLogin} 847 847 . "' ingroup '" 848 . $ TWiki::cfg{SuperAdminGroup} . "'",848 . $Foswiki::cfg{SuperAdminGroup} . "'", 849 849 then => 0, 850 850 else => 1 … … 855 855 my $this = shift; 856 856 $this->simpleTest( 857 test => "'" . $ TWiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'",857 test => "'" . $Foswiki::cfg{DefaultUserLogin} . "' ingroup 'GropeGroup'", 858 858 then => 1, 859 859 else => 0 … … 863 863 sub test_90 { 864 864 my $this = shift; 865 $this->simpleTest( test => "isweb ' TWiki'", then => 1, else => 0 );865 $this->simpleTest( test => "isweb 'System'", then => 1, else => 0 ); 866 866 } 867 867 … … 873 873 sub test_92 { 874 874 my $this = shift; 875 $this->simpleTest( test => "istopic \$' TWiki'", then => 0, else => 1 );875 $this->simpleTest( test => "istopic \$'System'", then => 0, else => 1 ); 876 876 } 877 877 … … 935 935 "GropeGroup", 936 936 " * Set GROUP = " 937 . TWiki::Func::getWikiName( $this->{twiki}->{user} ) . "\n"937 . Foswiki::Func::getWikiName( $this->{twiki}->{user} ) . "\n" 938 938 ); 939 939 … … 951 951 my ( $this, %test ) = @_; 952 952 $this->{twiki}->enterContext('test'); 953 $ TWiki::cfg{Fnargle} = 'Fleeble';954 $ TWiki::cfg{A}{B} = 'C';953 $Foswiki::cfg{Fnargle} = 'Fleeble'; 954 $Foswiki::cfg{A}{B} = 'C'; 955 955 $this->{request}->param('notempty','v'); 956 956 $this->{request}->param('empty',''); … … 963 963 964 964 my $meta = 965 new TWiki::Meta( $this->{twiki}, $this->{test_web}, $this->{test_topic} );965 new Foswiki::Meta( $this->{twiki}, $this->{test_web}, $this->{test_topic} ); 966 966 my $text = '%IF{"' 967 967 . $test{test} … … 1038 1038 sub test_ALLOWS_and_EXISTS { 1039 1039 my $this = shift; 1040 my $wn = TWiki::Func::getWikiName( $this->{twiki}->{user} );1040 my $wn = Foswiki::Func::getWikiName( $this->{twiki}->{user} ); 1041 1041 $this->{twiki}->{store} 1042 1042 ->saveTopic( $this->{twiki}->{user}, $this->{test_web}, "DeadDog", … … 1184 1184 1185 1185 $this->{twiki}->finish(); 1186 $this->{twiki} = new TWiki();1186 $this->{twiki} = new Foswiki(); 1187 1187 $this->{twiki}->{webName} = $this->{test_web}; # hack 1188 1188 … … 1231 1231 $this->{twiki}->{store}->topicExists( $this->{test_web}, $topicName ) ); 1232 1232 1233 #TODO: these need to be moved into Fn_META and then implemented (its a really simple change in TWiki.pm1233 #TODO: these need to be moved into Fn_META and then implemented (its a really simple change in Foswiki.pm 1234 1234 # $this->assert_str_equals( 1235 1235 # $this->{twiki}->handleCommonTags(
Note: See TracChangeset
for help on using the changeset viewer.
