Changeset 13946
- Timestamp:
- 02/11/12 04:20:24 (3 months ago)
- File:
-
- 1 edited
-
trunk/UnitTestContrib/test/unit/ClientTests.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/test/unit/ClientTests.pm
r13846 r13946 13 13 use Unit::Request(); 14 14 use Error qw( :try ); 15 use Digest::MD5 qw(md5_hex); 15 16 16 17 my $agent = $Foswiki::cfg{Register}{RegistrationAgentWikiName}; … … 190 191 } 191 192 my $secret = "a big mole on my left buttock"; 192 my $crypted = crypt( $secret, "12" ); 193 194 # Test new style MD5 hashed password 195 my $crypted = '$1234asdf$' . Digest::MD5::md5_hex( '$1234asdf$' . $secret ); 193 196 $Foswiki::cfg{Password} = $crypted; 194 197 … … 213 216 $this->{session}->{response}->headers()->{Location} ); 214 217 218 # Verify that old crypted password works 219 $crypted = crypt( $secret, "12" ); 220 $Foswiki::cfg{Password} = $crypted; 221 222 # SMELL: 8 character truncated password will match. 223 $secret = substr( $secret, 0, 8 ); 224 225 $query = Unit::Request->new( 226 { 227 username => [ $Foswiki::cfg{AdminUserLogin} ], 228 password => [$secret], 229 Logon => [1], 230 skin => ['none'], 231 } 232 ); 233 $query->path_info("/$this->{test_web}/$this->{test_topic}"); 234 235 $this->createNewFoswikiSession( undef, $query ); 236 $this->{session}->getLoginManager()->login( $query, $this->{session} ); 237 $script = $Foswiki::cfg{LoginManager} =~ /Apache/ ? 'viewauth' : 'view'; 238 $surly = 239 $this->{session} 240 ->getScriptUrl( 0, $script, $this->{test_web}, $this->{test_topic} ); 241 $this->assert_matches( qr/^302/, $this->{session}->{response}->status() ); 242 $this->assert_matches( qr/^$surly/, 243 $this->{session}->{response}->headers()->{Location} ); 244 215 245 return; 216 246 }
Note: See TracChangeset
for help on using the changeset viewer.
