Skip to content

Commit

Permalink
Item14563: Fix password unit tests
Browse files Browse the repository at this point in the history
The email address names are quoted by some versions of Perl
Email::Address

Also, an email address has to be set to test the email functions.

Revert accidental changes to WebStatistcs.
  • Loading branch information
gac410 committed Mar 6, 2018
1 parent d48cfbe commit cf182b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ sub loadExtraConfig {
my ( $this, $context, @args ) = @_;
$this->SUPER::loadExtraConfig( $context, @args );
$Foswiki::cfg{EnableEmail} = 1;
$Foswiki::cfg{WebMasterEmail} = 'dummyaddr@foswiki.org';

return;
}
Expand Down Expand Up @@ -111,7 +112,7 @@ sub test_resetPasswordOkay {
$this->assert_equals( 1, scalar(@FoswikiFnTestCase::mails) );
my $mess = $FoswikiFnTestCase::mails[0];
$this->assert_matches(
qr/$Foswiki::cfg{WebMasterName} <$Foswiki::cfg{WebMasterEmail}>/,
qr/"?$Foswiki::cfg{WebMasterName}"? <$Foswiki::cfg{WebMasterEmail}>/,
$mess->header('From') );
$this->assert_matches( qr/.*\bwhite\@example.com/, $mess->header('To') );

Expand Down Expand Up @@ -230,7 +231,7 @@ sub test_resetPasswordByEmail {

my $mess = $FoswikiFnTestCase::mails[0];
$this->assert_matches(
qr/$Foswiki::cfg{WebMasterName} <$Foswiki::cfg{WebMasterEmail}>/,
qr/"?$Foswiki::cfg{WebMasterName}"? <$Foswiki::cfg{WebMasterEmail}>/,
$mess->header('From') );
$this->assert_matches( qr/.*\bwhite\@example.com/, $mess->header('To') );

Expand Down Expand Up @@ -378,7 +379,7 @@ sub test_resetPasswordMultipleUsers {

my $mess = $FoswikiFnTestCase::mails[0];
$this->assert_matches(
qr/$Foswiki::cfg{WebMasterName} <$Foswiki::cfg{WebMasterEmail}>/,
qr/"?$Foswiki::cfg{WebMasterName}"? <$Foswiki::cfg{WebMasterEmail}>/,
$mess->header('From') );
$this->assert_matches( qr/.*\bwhite\@example.com/, $mess->header('To') );

Expand Down
3 changes: 1 addition & 2 deletions core/data/TestCases/WebStatistics.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
%META:TOPICINFO{author="scum" comment="" date="1519012307" format="1.1" reprev="2" version="2"}%
%META:TOPICINFO{author="scum" comment="" date="1520313953" format="1.1" reprev="2" version="2"}%
%META:TOPICPARENT{name="WebHome"}%
---++ Statistics for <nop>%WEB% Web

| *Month:* | *Topic <br /> views:* | *Topic <br /> saves:* | *File <br /> uploads:* | *Most popular <br /> topic views:* | *Top contributors for <br /> topic save and uploads:* |
| <!--statDate--> | <!--statViews--> | <!--statSaves--> | <!--statUploads--> | <!--statTopViews--> | <!--statTopContributors--> |
| Feb 2018 | 24 | 0 | 0 | &nbsp;&nbsp;1 [[TestCaseAutoSearchOrder]]<br />&nbsp;&nbsp;1 [[TestCaseAutoIncludes]]<br />&nbsp;&nbsp;1 [[TestCaseAutoFormattedSearch]]<br />&nbsp;&nbsp;1 [[TestCaseAutoUnexpandedTagsInSearchResults]]<br />&nbsp;&nbsp;1 [[TestCaseAutoInOutPre]]<br />&nbsp;&nbsp;1 [[TestCaseAutoInterwikiPlugin]]<br />&nbsp;&nbsp;1 [[TestCaseAutoIncludeAttachment]]<br />&nbsp;&nbsp;1 [[TestCaseAutoSearch]]<br />&nbsp;&nbsp;1 [[TestCaseAutoInternalTags]]<br />&nbsp;&nbsp;1 [[TestCaseAutoIncludeSubWebTopic]]<br />&nbsp;&nbsp;1 [[TestCaseAutoNestedVerbatim]] | |

*Notes:*
* Do not edit this topic, it is updated automatically. (You can also [[%SCRIPTURL{"statistics"}%/%WEB%][force]] an update)
Expand Down

0 comments on commit cf182b6

Please sign in to comment.