summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
Diffstat (limited to '_test')
-rw-r--r--_test/cases/inc/IXR_Library_IXR_Message.test.php2
-rw-r--r--_test/cases/inc/IXR_Library_date.test.php2
-rw-r--r--_test/cases/inc/auth_aclcheck.test.php2
-rw-r--r--_test/cases/inc/auth_admincheck.test.php90
-rw-r--r--_test/cases/inc/auth_nameencode.test.php2
-rw-r--r--_test/cases/inc/auth_password.test.php12
-rw-r--r--_test/cases/inc/common_clientip.test.php2
-rw-r--r--_test/cases/inc/common_obfuscate.test.php2
-rw-r--r--_test/cases/inc/common_pagetemplate.test.php2
-rw-r--r--_test/cases/inc/indexer_idx_indexlengths.test.php2
-rw-r--r--_test/cases/inc/init_fullpath.test.php2
-rw-r--r--_test/cases/inc/init_getbaseurl.test.php27
-rw-r--r--_test/cases/inc/mail_isvalid.test.php2
-rw-r--r--_test/cases/inc/mail_quoted_printable_encode.php2
-rw-r--r--_test/cases/inc/mail_send.php2
-rw-r--r--_test/cases/inc/pageutils_clean_id.test.php2
-rw-r--r--_test/cases/inc/pageutils_getid.test.php2
-rw-r--r--_test/cases/inc/pageutils_resolve_id.test.php2
-rw-r--r--_test/cases/inc/pageutils_resolve_pageid.test.php2
-rw-r--r--_test/cases/inc/parser/xhtml_links.test.php4
-rw-r--r--_test/cases/inc/safefn.test.php2
-rw-r--r--_test/cases/inc/utf8_correctidx.test.php2
-rw-r--r--_test/cases/inc/utf8_html.test.php2
-rw-r--r--_test/cases/inc/utf8_romanize.test.php2
-rw-r--r--_test/cases/inc/utf8_stripspecials.test.php2
-rw-r--r--_test/cases/inc/utf8_substr.test.php2
-rw-r--r--_test/cases/inc/utf8_unicode.test.php2
-rw-r--r--_test/cases/inc/utf8_utf16be.test.php2
-rw-r--r--_test/cases/lib/exe/css_css_compress.test.php2
-rw-r--r--_test/cases/lib/exe/css_css_loadfile.test.php57
-rw-r--r--_test/cases/lib/exe/js_js_compress.test.php2
31 files changed, 205 insertions, 37 deletions
diff --git a/_test/cases/inc/IXR_Library_IXR_Message.test.php b/_test/cases/inc/IXR_Library_IXR_Message.test.php
index 2a8133230..bc9be572d 100644
--- a/_test/cases/inc/IXR_Library_IXR_Message.test.php
+++ b/_test/cases/inc/IXR_Library_IXR_Message.test.php
@@ -136,4 +136,4 @@ class ixr_library_ixr_message_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/IXR_Library_date.test.php b/_test/cases/inc/IXR_Library_date.test.php
index a2b6154d8..28fa86486 100644
--- a/_test/cases/inc/IXR_Library_date.test.php
+++ b/_test/cases/inc/IXR_Library_date.test.php
@@ -31,4 +31,4 @@ class ixr_library_date_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/auth_aclcheck.test.php b/_test/cases/inc/auth_aclcheck.test.php
index d8a8f285a..ff092c2de 100644
--- a/_test/cases/inc/auth_aclcheck.test.php
+++ b/_test/cases/inc/auth_aclcheck.test.php
@@ -228,4 +228,4 @@ class auth_acl_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/auth_admincheck.test.php b/_test/cases/inc/auth_admincheck.test.php
index f14d6369e..a71c8801a 100644
--- a/_test/cases/inc/auth_admincheck.test.php
+++ b/_test/cases/inc/auth_admincheck.test.php
@@ -3,20 +3,47 @@
require_once DOKU_INC.'inc/init.php';
require_once DOKU_INC.'inc/auth.php';
+class auth_admin_test_AuthInSensitive extends auth_basic {
+ function isCaseSensitive(){
+ return false;
+ }
+}
+
class auth_admin_test extends UnitTestCase {
+ private $oldauth;
+
+ function setup() {
+ global $auth;
+ $this->oldauth = $auth;
+ parent::setup();
+ }
+
+ function setSensitive() {
+ global $auth;
+ $auth = new auth_basic;
+ }
+
+ function setInSensitive() {
+ global $auth;
+ $auth = new auth_admin_test_AuthInSensitive;
+ }
+
function teardown() {
+ global $auth;
global $conf;
global $AUTH_ACL;
unset($conf);
unset($AUTH_ACL);
-
+ $auth = $this->oldauth;
+ parent::teardown();
}
- function test_ismanager(){
+ function test_ismanager_insensitive(){
+ $this->setInSensitive();
global $conf;
- $conf['superuser'] = 'john,@admin';
- $conf['manager'] = 'john,@managers,doe';
+ $conf['superuser'] = 'john,@admin,@Mötly Görls, Dörte';
+ $conf['manager'] = 'john,@managers,doe, @Mötly Böys, Dänny';
// anonymous user
$this->assertEqual(auth_ismanager('jill', null,false), false);
@@ -25,12 +52,19 @@ class auth_admin_test extends UnitTestCase {
$this->assertEqual(auth_ismanager('john', null,false), true);
$this->assertEqual(auth_ismanager('doe', null,false), true);
+ $this->assertEqual(auth_ismanager('dörte', null,false), true);
+ $this->assertEqual(auth_ismanager('dänny', null,false), true);
+
// admin or manager groups
$this->assertEqual(auth_ismanager('jill', array('admin'),false), true);
$this->assertEqual(auth_ismanager('jill', array('managers'),false), true);
+
+ $this->assertEqual(auth_ismanager('jill', array('mötly görls'),false), true);
+ $this->assertEqual(auth_ismanager('jill', array('mötly böys'),false), true);
}
- function test_isadmin(){
+ function test_isadmin_insensitive(){
+ $this->setInSensitive();
global $conf;
$conf['superuser'] = 'john,@admin,doe,@roots';
@@ -48,6 +82,50 @@ class auth_admin_test extends UnitTestCase {
$this->assertEqual(auth_ismanager('doe', array('admin'),true), true);
}
+ function test_ismanager_sensitive(){
+ $this->setSensitive();
+ global $conf;
+ $conf['superuser'] = 'john,@admin,@Mötly Görls, Dörte';
+ $conf['manager'] = 'john,@managers,doe, @Mötly Böys, Dänny';
+
+ // anonymous user
+ $this->assertEqual(auth_ismanager('jill', null,false), false);
+
+ // admin or manager users
+ $this->assertEqual(auth_ismanager('john', null,false), true);
+ $this->assertEqual(auth_ismanager('doe', null,false), true);
+
+ $this->assertEqual(auth_ismanager('dörte', null,false), false);
+ $this->assertEqual(auth_ismanager('dänny', null,false), false);
+
+ // admin or manager groups
+ $this->assertEqual(auth_ismanager('jill', array('admin'),false), true);
+ $this->assertEqual(auth_ismanager('jill', array('managers'),false), true);
+
+ $this->assertEqual(auth_ismanager('jill', array('mötly görls'),false), false);
+ $this->assertEqual(auth_ismanager('jill', array('mötly böys'),false), false);
+ }
+
+ function test_isadmin_sensitive(){
+ $this->setSensitive();
+ global $conf;
+ $conf['superuser'] = 'john,@admin,doe,@roots';
+
+ // anonymous user
+ $this->assertEqual(auth_ismanager('jill', null,true), false);
+
+ // admin user
+ $this->assertEqual(auth_ismanager('john', null,true), true);
+ $this->assertEqual(auth_ismanager('Doe', null,true), false);
+
+ // admin groups
+ $this->assertEqual(auth_ismanager('jill', array('admin'),true), true);
+ $this->assertEqual(auth_ismanager('jill', array('roots'),true), true);
+ $this->assertEqual(auth_ismanager('john', array('admin'),true), true);
+ $this->assertEqual(auth_ismanager('doe', array('admin'),true), true);
+ $this->assertEqual(auth_ismanager('Doe', array('admin'),true), true);
+ }
+
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/auth_nameencode.test.php b/_test/cases/inc/auth_nameencode.test.php
index 28ab6dc4a..56806a862 100644
--- a/_test/cases/inc/auth_nameencode.test.php
+++ b/_test/cases/inc/auth_nameencode.test.php
@@ -47,4 +47,4 @@ class auth_nameencode_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/auth_password.test.php b/_test/cases/inc/auth_password.test.php
index 1ba731c7e..140c7c23e 100644
--- a/_test/cases/inc/auth_password.test.php
+++ b/_test/cases/inc/auth_password.test.php
@@ -15,6 +15,9 @@ class auth_password_test extends UnitTestCase {
'crypt' => 'ablvoGr1hvZ5k',
'mysql' => '4a1fa3780bd6fd55',
'my411' => '*e5929347e25f82e19e4ebe92f1dc6b6e7c2dbd29',
+ 'kmd5' => 'a579299436d7969791189acadd86fcb716',
+ 'pmd5' => '$P$abcdefgh1RC6Fd32heUzl7EYCG9uGw.',
+ 'hmd5' => '$H$abcdefgh1ZbJodHxmeXVAhEzTG7IAp.',
);
@@ -22,7 +25,7 @@ class auth_password_test extends UnitTestCase {
foreach($this->passes as $method => $hash){
$info = "testing method $method";
$this->signal('failinfo',$info);
- $this->assertEqual(auth_cryptPassword('foo'.$method,$method,'abcdefgh'),$hash);
+ $this->assertEqual(auth_cryptPassword('foo'.$method,$method,'abcdefgh12345678912345678912345678'),$hash);
}
}
@@ -38,6 +41,11 @@ class auth_password_test extends UnitTestCase {
$this->assertTrue(auth_verifyPassword('foo','$1$$n1rTiFE0nRifwV/43bVon/'));
}
+ function test_verifyPassword_fixedpmd5(){
+ $this->assertTrue(auth_verifyPassword('test12345','$P$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0'));
+ $this->assertTrue(auth_verifyPassword('test12345','$H$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0'));
+ }
+
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/common_clientip.test.php b/_test/cases/inc/common_clientip.test.php
index 4df463539..68c108165 100644
--- a/_test/cases/inc/common_clientip.test.php
+++ b/_test/cases/inc/common_clientip.test.php
@@ -152,4 +152,4 @@ class common_clientIP_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/common_obfuscate.test.php b/_test/cases/inc/common_obfuscate.test.php
index 3e1e1a72f..31321bea1 100644
--- a/_test/cases/inc/common_obfuscate.test.php
+++ b/_test/cases/inc/common_obfuscate.test.php
@@ -25,4 +25,4 @@ class common_obfuscate_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/common_pagetemplate.test.php b/_test/cases/inc/common_pagetemplate.test.php
index ecba0f966..2db8b64ae 100644
--- a/_test/cases/inc/common_pagetemplate.test.php
+++ b/_test/cases/inc/common_pagetemplate.test.php
@@ -16,4 +16,4 @@ class common_pagetemplate_test extends UnitTestCase {
error_reporting($old);
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/indexer_idx_indexlengths.test.php b/_test/cases/inc/indexer_idx_indexlengths.test.php
index 8565639be..a0f7c9224 100644
--- a/_test/cases/inc/indexer_idx_indexlengths.test.php
+++ b/_test/cases/inc/indexer_idx_indexlengths.test.php
@@ -57,4 +57,4 @@ class indexer_idx_indexlengths_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/init_fullpath.test.php b/_test/cases/inc/init_fullpath.test.php
index 63394b09d..aa63b0ce9 100644
--- a/_test/cases/inc/init_fullpath.test.php
+++ b/_test/cases/inc/init_fullpath.test.php
@@ -86,4 +86,4 @@ class init_fullpath_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/init_getbaseurl.test.php b/_test/cases/inc/init_getbaseurl.test.php
index edd370d61..a22172feb 100644
--- a/_test/cases/inc/init_getbaseurl.test.php
+++ b/_test/cases/inc/init_getbaseurl.test.php
@@ -275,6 +275,31 @@ class init_getBaseURL_test extends UnitTestCase {
$this->assertEqual(getBaseURL(true),$correct_result);
}
}
+
+ /**
+ * Absolute URL with IPv6 domain name.
+ * lighttpd, fastcgi
+ *
+ * data provided by Michael Hamann <michael@content-space.de>
+ */
+ function test12() {
+ global $conf;
+ $conf['basedir'] = '';
+ $conf['baseurl'] = '';
+ $conf['canonical'] = 0;
+
+ $_SERVER['DOCUMENT_ROOT'] = '/srv/http/';
+ $_SERVER['HTTP_HOST'] = '[fd00::6592:39ed:a2ed:2c78]';
+ $_SERVER['SCRIPT_FILENAME'] = '/srv/http/~michitux/dokuwiki/doku.php';
+ $_SERVER['REQUEST_URI'] = '/~michitux/dokuwiki/doku.php?do=debug';
+ $_SERVER['SCRIPT_NAME'] = '/~michitux/dokuwiki/doku.php';
+ $_SERVER['PATH_INFO'] = null;
+ $_SERVER['PATH_TRANSLATED'] = null;
+ $_SERVER['PHP_SELF'] = '/~michitux/dokuwiki/doku.php';
+ $_SERVER['SERVER_PORT'] = '80';
+ $_SERVER['SERVER_NAME'] = '[fd00';
+ $this->assertEqual(getBaseURL(true), 'http://[fd00::6592:39ed:a2ed:2c78]/~michitux/dokuwiki/');
+ }
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/_test/cases/inc/mail_isvalid.test.php b/_test/cases/inc/mail_isvalid.test.php
index 374204679..4e047499f 100644
--- a/_test/cases/inc/mail_isvalid.test.php
+++ b/_test/cases/inc/mail_isvalid.test.php
@@ -80,4 +80,4 @@ class mail_isvalid extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/mail_quoted_printable_encode.php b/_test/cases/inc/mail_quoted_printable_encode.php
index c9cb040f1..a5a36e35b 100644
--- a/_test/cases/inc/mail_quoted_printable_encode.php
+++ b/_test/cases/inc/mail_quoted_printable_encode.php
@@ -41,4 +41,4 @@ class mail_quotedprintable_encode extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/mail_send.php b/_test/cases/inc/mail_send.php
index 5c2b0e896..e41c501fe 100644
--- a/_test/cases/inc/mail_send.php
+++ b/_test/cases/inc/mail_send.php
@@ -46,4 +46,4 @@ class mail_send extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/pageutils_clean_id.test.php b/_test/cases/inc/pageutils_clean_id.test.php
index 9c03ce334..01fa7dc1c 100644
--- a/_test/cases/inc/pageutils_clean_id.test.php
+++ b/_test/cases/inc/pageutils_clean_id.test.php
@@ -144,4 +144,4 @@ class init_clean_id_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/pageutils_getid.test.php b/_test/cases/inc/pageutils_getid.test.php
index e3932a579..7fccc3a60 100644
--- a/_test/cases/inc/pageutils_getid.test.php
+++ b/_test/cases/inc/pageutils_getid.test.php
@@ -103,4 +103,4 @@ class init_getID_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/pageutils_resolve_id.test.php b/_test/cases/inc/pageutils_resolve_id.test.php
index 64b4033cd..9aa4ee8b7 100644
--- a/_test/cases/inc/pageutils_resolve_id.test.php
+++ b/_test/cases/inc/pageutils_resolve_id.test.php
@@ -42,4 +42,4 @@ class init_resolve_id_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/pageutils_resolve_pageid.test.php b/_test/cases/inc/pageutils_resolve_pageid.test.php
index ab282b57a..d9ea89869 100644
--- a/_test/cases/inc/pageutils_resolve_pageid.test.php
+++ b/_test/cases/inc/pageutils_resolve_pageid.test.php
@@ -60,4 +60,4 @@ class init_resolve_pageid_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/parser/xhtml_links.test.php b/_test/cases/inc/parser/xhtml_links.test.php
index 6a74445b0..0ad96c793 100644
--- a/_test/cases/inc/parser/xhtml_links.test.php
+++ b/_test/cases/inc/parser/xhtml_links.test.php
@@ -12,7 +12,7 @@ class xhtml_links_test extends UnitTestCase {
$p = new Doku_Renderer_xhtml();
$p->emaillink('foo@example.com','<script>alert(\'"alert"\');</script>');
- $expect = '<a href="mailto:foo%20%5Bat%5D%20example%20%5Bdot%5D%20com" class="mail JSnocheck" title="foo [at] example [dot] com">&lt;script&gt;alert(&#039;&quot;alert&quot;&#039;);&lt;/script&gt;</a>';
+ $expect = '<a href="mailto:foo%20%5Bat%5D%20example%20%5Bdot%5D%20com" class="mail" title="foo [at] example [dot] com">&lt;script&gt;alert(&#039;&quot;alert&quot;&#039;);&lt;/script&gt;</a>';
$this->assertEqual($p->doc,$expect);
}
@@ -36,7 +36,7 @@ class xhtml_links_test extends UnitTestCase {
$p = new Doku_Renderer_xhtml();
$p->emaillink('foo@example.com',$image);
- $expect = '<a href="mailto:foo%20%5Bat%5D%20example%20%5Bdot%5D%20com" class="media JSnocheck" title="foo [at] example [dot] com"><img src="'.DOKU_BASE.'lib/exe/fetch.php/img.gif?w=10&amp;h=20&amp;cache=nocache" class="media" title="Some Image" alt="Some Image" width="10" height="20" /></a>';
+ $expect = '<a href="mailto:foo%20%5Bat%5D%20example%20%5Bdot%5D%20com" class="media" title="foo [at] example [dot] com"><img src="'.DOKU_BASE.'lib/exe/fetch.php/img.gif?w=10&amp;h=20&amp;cache=nocache" class="media" title="Some Image" alt="Some Image" width="10" height="20" /></a>';
$this->assertEqual($p->doc,$expect);
}
diff --git a/_test/cases/inc/safefn.test.php b/_test/cases/inc/safefn.test.php
index b93914bf8..c789875ba 100644
--- a/_test/cases/inc/safefn.test.php
+++ b/_test/cases/inc/safefn.test.php
@@ -32,4 +32,4 @@ class safeFN_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_correctidx.test.php b/_test/cases/inc/utf8_correctidx.test.php
index d95ce9ae0..20f6ba3a3 100644
--- a/_test/cases/inc/utf8_correctidx.test.php
+++ b/_test/cases/inc/utf8_correctidx.test.php
@@ -75,4 +75,4 @@ class utf8_correctidx_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_html.test.php b/_test/cases/inc/utf8_html.test.php
index 57c9df259..3e6d35bc7 100644
--- a/_test/cases/inc/utf8_html.test.php
+++ b/_test/cases/inc/utf8_html.test.php
@@ -69,4 +69,4 @@ class utf8_html_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_romanize.test.php b/_test/cases/inc/utf8_romanize.test.php
index 9aade570b..950c8842a 100644
--- a/_test/cases/inc/utf8_romanize.test.php
+++ b/_test/cases/inc/utf8_romanize.test.php
@@ -33,4 +33,4 @@ class utf8_romanize_test extends UnitTestCase {
$this->assertEqual("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö"));
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_stripspecials.test.php b/_test/cases/inc/utf8_stripspecials.test.php
index a42507a3c..85df75fa1 100644
--- a/_test/cases/inc/utf8_stripspecials.test.php
+++ b/_test/cases/inc/utf8_stripspecials.test.php
@@ -24,4 +24,4 @@ class utf8_stripspecials extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_substr.test.php b/_test/cases/inc/utf8_substr.test.php
index f3bf1b154..2806d34f1 100644
--- a/_test/cases/inc/utf8_substr.test.php
+++ b/_test/cases/inc/utf8_substr.test.php
@@ -40,4 +40,4 @@ class utf8_substr_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_unicode.test.php b/_test/cases/inc/utf8_unicode.test.php
index 453aad216..424f47d11 100644
--- a/_test/cases/inc/utf8_unicode.test.php
+++ b/_test/cases/inc/utf8_unicode.test.php
@@ -57,4 +57,4 @@ class utf8_unicode_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_utf16be.test.php b/_test/cases/inc/utf8_utf16be.test.php
index 3a346da51..d8b8746f2 100644
--- a/_test/cases/inc/utf8_utf16be.test.php
+++ b/_test/cases/inc/utf8_utf16be.test.php
@@ -25,4 +25,4 @@ class utf8_utf16be_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/_test/cases/lib/exe/css_css_compress.test.php b/_test/cases/lib/exe/css_css_compress.test.php
index 026caad3c..527071bbe 100644
--- a/_test/cases/lib/exe/css_css_compress.test.php
+++ b/_test/cases/lib/exe/css_css_compress.test.php
@@ -65,4 +65,4 @@ class css_css_compress_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/lib/exe/css_css_loadfile.test.php b/_test/cases/lib/exe/css_css_loadfile.test.php
new file mode 100644
index 000000000..a444d0086
--- /dev/null
+++ b/_test/cases/lib/exe/css_css_loadfile.test.php
@@ -0,0 +1,57 @@
+<?php
+
+require_once DOKU_INC.'lib/exe/css.php';
+
+class css_css_loadfile_test extends UnitTestCase {
+ public function setUp() {
+ $this->file = tempnam('/tmp', 'css');
+ parent::setUp();
+ }
+
+ private function csstest($input, $output = null, $location = 'http://www.example.com/') {
+ io_saveFile($this->file, $input);
+ $this->assertEqual(css_loadfile($this->file, $location), (is_null($output) ? $input : $output));
+ }
+
+ public function test_url_relative() {
+ $this->csstest('#test { background: url("test/test.png"); }', '#test { background: url("http://www.example.com/test/test.png"); }');
+ $this->csstest('#test { background: url(\'test/test.png\'); }', '#test { background: url(\'http://www.example.com/test/test.png\'); }');
+ }
+
+ public function test_url_absolute() {
+ $this->csstest('#test { background: url("/test/test.png"); }');
+ $this->csstest('#test { background: url(\'/test/test.png\'); }');
+ }
+
+ public function test_url_with_protocol() {
+ $this->csstest('#test { background: url("http://www.test.com/test/test.png"); }');
+ $this->csstest('#test { background: url("https://www.test.com/test/test.png"); }');
+ $this->csstest('#test { background: url(\'http://www.test.com/test/test.png\'); }');
+ $this->csstest('#test { background: url(\'https://www.test.com/test/test.png\'); }');
+ }
+
+ public function test_import_relative() {
+ $this->csstest('@import "test/test.png";', '@import "http://www.example.com/test/test.png";');
+ $this->csstest('@import \'test/test.png\';', '@import \'http://www.example.com/test/test.png\';');
+ }
+
+ public function test_import_absolute() {
+ $this->csstest('@import "/test/test.png";');
+ $this->csstest('@import \'/test/test.png\';');
+ }
+
+ public function test_import_with_protocol() {
+ $this->csstest('@import "http://www.test.com/test/test.png";');
+ $this->csstest('@import "https://www.test.com/test/test.png";');
+ $this->csstest('@import \'http://www.test.com/test/test.png\';');
+ $this->csstest('@import \'https://www.test.com/test/test.png\';');
+ }
+
+ public function tearDown() {
+ unlink($this->file);
+ unset($this->file);
+ parent::tearDown();
+ }
+}
+
+//Setup VIM: ex: et ts=4 sw=4 :
diff --git a/_test/cases/lib/exe/js_js_compress.test.php b/_test/cases/lib/exe/js_js_compress.test.php
index 9051dfb01..76b51e5ab 100644
--- a/_test/cases/lib/exe/js_js_compress.test.php
+++ b/_test/cases/lib/exe/js_js_compress.test.php
@@ -120,4 +120,4 @@ class js_js_compress_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :