Permalink
Browse files

Item10962: Disable AutoDetect in tests

If it's enabled for the site, some tests might give false success if an
improperly encoded password is auto-matched.  Disable before most tests
to be sure.

git-svn-id: http://svn.foswiki.org/branches/Release01x01@12239 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information...
GeorgeClark GeorgeClark
GeorgeClark authored and GeorgeClark committed Jul 25, 2011
1 parent 7ddf047 commit 0da93de7760575359a94ca9b7d4a02e7ecddef01
Showing with 7 additions and 0 deletions.
  1. +7 −0 UnitTestContrib/test/unit/PasswordTests.pm
@@ -356,6 +356,7 @@ sub dumpFile {
sub test_htpasswd_crypt_md5 {
my $this = shift;
$Foswiki::cfg{Htpasswd}{AutoDetect} = 0;
$Foswiki::cfg{Htpasswd}{Encoding} = 'crypt-md5';
my $impl = new Foswiki::Users::HtPasswdUser( $this->{session} );
$this->assert($impl);
@@ -365,6 +366,7 @@ sub test_htpasswd_crypt_md5 {
sub test_htpasswd_crypt_crypt {
my $this = shift;
$Foswiki::cfg{Htpasswd}{AutoDetect} = 0;
$Foswiki::cfg{Htpasswd}{Encoding} = 'crypt';
my $impl = new Foswiki::Users::HtPasswdUser( $this->{session} );
$this->assert($impl);
@@ -382,6 +384,7 @@ sub test_htpasswd_sha1 {
$this->annotate("CANNOT RUN SHA1 TESTS: $mess");
}
$Foswiki::cfg{Htpasswd}{AutoDetect} = 0;
$Foswiki::cfg{Htpasswd}{Encoding} = 'sha1';
my $impl = new Foswiki::Users::HtPasswdUser( $this->{session} );
$this->assert($impl);
@@ -391,6 +394,7 @@ sub test_htpasswd_sha1 {
sub test_htpasswd_plain {
my $this = shift;
$Foswiki::cfg{Htpasswd}{AutoDetect} = 0;
$Foswiki::cfg{Htpasswd}{Encoding} = 'plain';
my $impl = new Foswiki::Users::HtPasswdUser( $this->{session} );
$this->assert($impl);
@@ -401,6 +405,7 @@ sub test_htpasswd_plain {
sub test_htpasswd_md5 {
my $this = shift;
$Foswiki::cfg{Htpasswd}{AutoDetect} = 0;
$Foswiki::cfg{Htpasswd}{Encoding} = 'md5';
my $impl = new Foswiki::Users::HtPasswdUser( $this->{session} );
$this->assert($impl);
@@ -411,6 +416,7 @@ sub test_htpasswd_md5 {
sub test_htpasswd_htdigest_md5 {
my $this = shift;
$Foswiki::cfg{Htpasswd}{AutoDetect} = 0;
$Foswiki::cfg{Htpasswd}{Encoding} = 'htdigest-md5';
my $impl = new Foswiki::Users::HtPasswdUser( $this->{session} );
$this->assert($impl);
@@ -437,6 +443,7 @@ sub test_htpasswd_apache_md5 {
$this->annotate("CANNOT RUN APACHE MD5 TESTS: $mess");
}
$Foswiki::cfg{Htpasswd}{AutoDetect} = 0;
$Foswiki::cfg{Htpasswd}{Encoding} = 'apache-md5';
my $impl = new Foswiki::Users::HtPasswdUser( $this->{session} );
$this->assert($impl);

0 comments on commit 0da93de

Please sign in to comment.