Skip to content

Commit 453cca2

Browse files
committed
test: slightly improve mail body test
replacing sleep with waitForTick should make the test faster, this also tests that we have the correct summary in the mail
1 parent faf1789 commit 453cca2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

_test/mail.unit.test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ function test_change_mail_body () {
4848
global $USERINFO;
4949
$_SERVER['REMOTE_USER'] = 'john';
5050
$USERINFO['name'] = 'John Smith';
51-
saveWikiText('start', 'start first', 'foobar');
51+
saveWikiText('start', 'start first', 'summary of save 1');
5252
$oldrevision = pageinfo();
5353
$oldrevision = $oldrevision['lastmod'];
54-
sleep(1);
54+
$this->waitForTick(true);
5555
global $INFO;
5656
$INFO = pageinfo();
57-
saveWikiText('start', 'start second', 'foobar');
57+
saveWikiText('start', 'start second', 'summary of save 2');
5858
$newrevision = pageinfo();
5959
$newrevision = $newrevision['lastmod'];
6060

@@ -67,7 +67,7 @@ function test_change_mail_body () {
6767
Hostname : @HOSTNAME@
6868
Previous Revision: http://wiki.example.com' . DOKU_BASE . 'doku.php?id=start&rev=' . $oldrevision . '
6969
New Revision : http://wiki.example.com' . DOKU_BASE . 'doku.php?id=start&rev=' . $newrevision . '
70-
Edit Summary : foobar
70+
Edit Summary : summary of save 2
7171
User : @USER@
7272
7373
http://wiki.example.com' . DOKU_BASE . 'doku.php?id=start&do=diff&rev2[0]=' . $oldrevision . '&rev2[1]=' . $newrevision . '&difftype=sidebyside

0 commit comments

Comments
 (0)