Skip to content

Commit

Permalink
Add testing of delayed writes to the remote API
Browse files Browse the repository at this point in the history
  • Loading branch information
michitux committed Jan 1, 2017
1 parent ea466a9 commit 7e95efe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions _test/tests/inc/remoteapicore.test.php
Expand Up @@ -40,6 +40,13 @@ public function tearDown() {
$AUTH_ACL = $this->oldAuthAcl;
}

/** Delay writes of old revisions by a second. */
public function handle_write(Doku_Event $event, $param) {
if ($event->data[3] !== false) {
$this->waitForTick();
}
}

public function test_getVersion() {
$this->assertEquals(getVersion(), $this->remote->call('dokuwiki.getVersion'));
}
Expand Down Expand Up @@ -382,6 +389,9 @@ public function test_getRecentChanges() {
}

public function test_getPageVersions() {
/** @var $EVENT_HANDLER Doku_Event_Handler */
global $EVENT_HANDLER;
$EVENT_HANDLER->register_hook('IO_WIKIPAGE_WRITE', 'BEFORE', $this, 'handle_write');
global $conf;

$id = 'revpage';
Expand Down

0 comments on commit 7e95efe

Please sign in to comment.