Changeset 13839
- Timestamp:
- 01/27/12 06:04:41 (4 weeks ago)
- Location:
- branches/Release01x01/TWikiCompatibilityPlugin
- Files:
-
- 2 edited
-
lib/TWiki.pm (modified) (1 diff)
-
test/unit/TWikiCompatibilityPlugin/TWikiFuncTests.pm (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/Release01x01/TWikiCompatibilityPlugin/lib/TWiki.pm
r7644 r13839 11 11 if ( !$Foswiki::Plugins::SESSION && UNIVERSAL::isa( $query, 'CGI' ) ) { 12 12 13 # Compatibility: User gave a CGI object 14 # This probably means we're inside a script 15 $query = undef; 13 ## Compatibility: User gave a CGI object 14 ## This probably means we're inside a script 15 ## $query = undef; 16 # The above was added in Item689, Foswikirev:1847. It doesn't make any 17 # sense to me. PH disabled under Item11431 ('no singleton left behind') 16 18 } 17 19 my $fatwilly = new Foswiki( $loginName, $query, $initialContext ); -
branches/Release01x01/TWikiCompatibilityPlugin/test/unit/TWikiCompatibilityPlugin/TWikiFuncTests.pm
r13427 r13839 45 45 my $this = shift; 46 46 47 $this->{session}->finish(); 48 $this->{session} = Foswiki->new( $Foswiki::cfg{AdminUserLogin} ); 47 $this->createNewFoswikiSession( $Foswiki::cfg{AdminUserLogin} ); 49 48 50 49 TWiki::Func::createWeb( $this->{test_web} . "/Blah" ); … … 62 61 my $this = shift; 63 62 64 $this->{session}->finish(); 65 $this->{session} = Foswiki->new( $Foswiki::cfg{AdminUserLogin} ); 63 $this->createNewFoswikiSession( $Foswiki::cfg{AdminUserLogin} ); 66 64 67 65 $this->assert( Foswiki::Func::webExists('TWiki') ); … … 99 97 $this->assert_matches( qr!/$ss/$this->{test_web}/WebHome!, $result ); 100 98 99 $this->finishFoswikiSession(); 101 100 $TWiki::Plugins::SESSION = 102 101 TWiki->new( undef, 103 102 Unit::Request->new( { topic => "Sausages.AndMash" } ) ); 103 $this->{session} = $TWiki::Plugins::SESSION; 104 104 105 105 $result = TWiki::Func::getViewUrl( "Sausages", "AndMash" ); … … 108 108 $result = TWiki::Func::getViewUrl( "", "AndMash" ); 109 109 $this->assert_matches( qr!/$ss/Sausages/AndMash!, $result ); 110 $ TWiki::Plugins::SESSION->finish();110 $this->createNewFoswikiSession(); 111 111 112 112 return; … … 126 126 my $q = Unit::Request->new( {} ); 127 127 $q->path_info('/Sausages/AndMash'); 128 $this->finishFoswikiSession(); 128 129 $TWiki::Plugins::SESSION = TWiki->new( undef, $q ); 130 $this->{session} = $TWiki::Plugins::SESSION; 129 131 130 132 $result = TWiki::Func::getScriptUrl( "Sausages", "AndMash", 'wibble' ); … … 133 135 $result = TWiki::Func::getScriptUrl( "", "AndMash", 'wibble' ); 134 136 $this->assert_matches( qr!/$ss/$this->{users_web}/AndMash!, $result ); 135 $ TWiki::Plugins::SESSION->finish();137 $this->createNewFoswikiSession(); 136 138 137 139 return; … … 546 548 END 547 549 ); 548 eval { $this->{session}->finish() };550 $this->finishFoswikiSession(); 549 551 $this->{session} = TWiki->new(); 550 552 $TWiki::Plugins::SESSION = $this->{session}; … … 610 612 ); 611 613 $this->assert( !$access ); 614 $this->createNewFoswikiSession(); 612 615 613 616 return; … … 624 627 END 625 628 ); 626 eval { $this->{session}->finish() };629 $this->finishFoswikiSession(); 627 630 $this->{session} = TWiki->new(); 628 631 $TWiki::Plugins::SESSION = $this->{session}; … … 888 891 my $this = shift; 889 892 $this->assert( TWiki::Func::isGuest(), $this->{session}->{user} ); 890 $this-> {session}->finish();893 $this->finishFoswikiSession(); 891 894 $this->{session} = TWiki->new( $TWiki::cfg{AdminUserLogin} ); 895 $TWiki::Plugins::SESSION = $this->{session}; 892 896 $this->assert( !TWiki::Func::isGuest(), $this->{session}->{user} ); 897 $this->createNewFoswikiSession(); 893 898 894 899 return; … … 909 914 * Set FINALPREFERENCES = PSIBG 910 915 HERE 911 $this-> {session}->finish();916 $this->finishFoswikiSession(); 912 917 $this->{session} = TWiki->new( $TWiki::cfg{GuestUserLogin}, $q ); 918 $TWiki::Plugins::SESSION = $this->{session}; 913 919 $this->assert_str_equals( "naff", 914 920 TWiki::Func::getPreferencesValue("PSIBG") ); … … 921 927 * Set PSIBG = naff 922 928 HERE 923 $this-> {session}->finish();929 $this->finishFoswikiSession(); 924 930 $this->{session} = TWiki->new( $TWiki::cfg{GuestUserLogin}, $q ); 931 $TWiki::Plugins::SESSION = $this->{session}; 925 932 $this->assert_str_equals( "naff", 926 933 TWiki::Func::getPreferencesValue("PSIBG") ); … … 928 935 $this->assert_str_equals( "KJHD", 929 936 TWiki::Func::getPreferencesValue("PSIBG") ); 937 $this->createNewFoswikiSession(); 930 938 931 939 return;
Note: See TracChangeset
for help on using the changeset viewer.
