Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into new_css.php
- Loading branch information
Showing
307 changed files
with
5,217 additions
and
1,213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<?php | ||
|
||
/** | ||
* Tests for requesting revisioninfo of a revision of a page with getRevisionInfo() | ||
* | ||
* This class uses the files: | ||
* - data/pages/mailinglist.txt | ||
* - data/meta/mailinglist.changes | ||
*/ | ||
class changelog_getlastrevisionat_test extends DokuWikiTest { | ||
|
||
private $pageid = 'mailinglist'; | ||
|
||
function setup() { | ||
parent::setup(); | ||
global $cache_revinfo; | ||
$cache =& $cache_revinfo; | ||
if(isset($cache['nonexist'])) { | ||
unset($cache['nonexist']); | ||
} | ||
if(isset($cache['mailinglist'])) { | ||
unset($cache['mailinglist']); | ||
} | ||
} | ||
|
||
|
||
/** | ||
* no nonexist.changes meta file available | ||
*/ | ||
function test_changemetadatanotexists() { | ||
$rev = 1362525899; | ||
$id = 'nonexist'; | ||
$revsexpected = false; | ||
|
||
$pagelog = new PageChangeLog($id, $chunk_size = 8192); | ||
$revs = $pagelog->getLastRevisionAt($rev); | ||
$this->assertEquals($revsexpected, $revs); | ||
} | ||
|
||
/** | ||
* start at exact current revision of mailinglist page | ||
* | ||
*/ | ||
function test_startatexactcurrentrev() { | ||
$rev = 1385051947; | ||
$revsexpected = ''; | ||
|
||
//set a known timestamp | ||
touch(wikiFN($this->pageid), $rev); | ||
|
||
$pagelog = new PageChangeLog($this->pageid, $chunk_size = 8192); | ||
$revs = $pagelog->getLastRevisionAt($rev); | ||
$this->assertEquals($revsexpected, $revs); | ||
|
||
} | ||
|
||
/** | ||
* test a future revision | ||
* | ||
*/ | ||
function test_futurerev() { | ||
$rev = 1385051947; | ||
$revsexpected = ''; | ||
|
||
//set a known timestamp | ||
touch(wikiFN($this->pageid), $rev); | ||
|
||
$rev +=1; | ||
|
||
$pagelog = new PageChangeLog($this->pageid, $chunk_size = 8192); | ||
$revs = $pagelog->getLastRevisionAt($rev); | ||
$this->assertEquals($revsexpected, $revs); | ||
|
||
} | ||
|
||
/** | ||
* start at exact last revision of mailinglist page | ||
* | ||
*/ | ||
function test_exactlastrev() { | ||
$rev = 1360110636; | ||
$revsexpected = 1360110636; | ||
|
||
$pagelog = new PageChangeLog($this->pageid, $chunk_size = 8192); | ||
$revs = $pagelog->getLastRevisionAt($rev); | ||
$this->assertEquals($revsexpected, $revs); | ||
} | ||
|
||
|
||
/** | ||
* Request not existing revision | ||
* | ||
*/ | ||
function test_olderrev() { | ||
$rev = 1; | ||
$revexpected = false; | ||
|
||
$pagelog = new PageChangeLog($this->pageid, $chunk_size = 8192); | ||
$revfound = $pagelog->getLastRevisionAt($rev); | ||
$this->assertEquals($revexpected, $revfound); | ||
} | ||
|
||
/** | ||
* Start at non existing revision somewhere between existing revisions | ||
*/ | ||
function test_notexistingrev() { | ||
$rev = 1362525890; | ||
$revexpected = 1362525359; | ||
|
||
$pagelog = new PageChangeLog($this->pageid, $chunk_size = 8192); | ||
$revfound = $pagelog->getLastRevisionAt($rev); | ||
$this->assertEquals($revexpected, $revfound); | ||
} | ||
|
||
/** | ||
* request nonexisting page | ||
* | ||
*/ | ||
function test_notexistingpage() { | ||
$rev = 1385051947; | ||
$currentexpected = false; | ||
|
||
$pagelog = new PageChangeLog('nonexistingpage', $chunk_size = 8192); | ||
$current = $pagelog->getLastRevisionAt($rev); | ||
$this->assertEquals($currentexpected, $current); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
class init_checkssl_test extends DokuWikiTest { | ||
|
||
/** | ||
* Running behind an SSL proxy, HTTP between server and proxy | ||
* HTTPS not set | ||
* HTTP_X_FORWARDED_PROTO | ||
* set to https | ||
*/ | ||
function test1() { | ||
$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'https'; | ||
|
||
$this->assertEquals(is_ssl(), true); | ||
} | ||
|
||
/** | ||
* Running behind a plain HTTP proxy, HTTP between server and proxy | ||
* HTTPS not set | ||
* HTTP_X_FORWARDED_PROTO set to http | ||
*/ | ||
function test2() { | ||
$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'http'; | ||
|
||
$this->assertEquals(is_ssl(), false); | ||
} | ||
|
||
/** | ||
* Running behind an SSL proxy, HTTP between server and proxy | ||
* HTTPS set to off, | ||
* HTTP_X_FORWARDED_PROTO set to https | ||
*/ | ||
function test3() { | ||
$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'https'; | ||
$_SERVER['HTTPS'] = 'off'; | ||
|
||
$this->assertEquals(is_ssl(), true); | ||
} | ||
|
||
/** | ||
* Not running behind a proxy, HTTPS server | ||
* HTTPS set to on, | ||
* HTTP_X_FORWARDED_PROTO not set | ||
*/ | ||
function test4() { | ||
$_SERVER['HTTPS'] = 'on'; | ||
|
||
$this->assertEquals(is_ssl(), true); | ||
} | ||
|
||
/** | ||
* Not running behind a proxy, plain HTTP server | ||
* HTTPS not set | ||
* HTTP_X_FORWARDED_PROTO not set | ||
*/ | ||
function test5() { | ||
$this->assertEquals(is_ssl(), false); | ||
} | ||
|
||
/** | ||
* Not running behind a proxy, plain HTTP server | ||
* HTTPS set to off | ||
* HTTP_X_FORWARDED_PROTO not set | ||
*/ | ||
function test6() { | ||
$_SERVER['HTTPS'] = 'off'; | ||
$this->assertEquals(is_ssl(), false); | ||
} | ||
|
||
/** | ||
* Running behind an SSL proxy, SSL between proxy and HTTP server | ||
* HTTPS set to on, | ||
* HTTP_X_FORWARDED_PROTO set to https | ||
*/ | ||
function test7() { | ||
$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'https'; | ||
$_SERVER['HTTPS'] = 'on'; | ||
|
||
$this->assertEquals(is_ssl(), true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.