summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2013-02-25 15:00:16 +0000
committerChristopher Smith <chris@jalakai.co.uk>2013-02-25 15:00:16 +0000
commit7ae29fa453970036576e8b18fe228c24a25e94ff (patch)
treee21193bdf4b238b2906153be67b8065d3fe932f7 /_test
parent1fe0882c56ea31e738540e942b743966927415fd (diff)
downloadrpg-7ae29fa453970036576e8b18fe228c24a25e94ff.tar.gz
rpg-7ae29fa453970036576e8b18fe228c24a25e94ff.tar.bz2
refactor info functions test
pageinfo() test no longer required, unit test committed elsewhere and verified against both previous and updated versions of pageinfo() fn. basicinfo() and mediainfo() tests separated each into their own test file.
Diffstat (limited to '_test')
-rw-r--r--_test/tests/inc/common_basicinfo.test.php (renamed from _test/tests/inc/common_infofunctions.test.php)0
-rw-r--r--_test/tests/inc/common_mediainfo.test.php49
2 files changed, 49 insertions, 0 deletions
diff --git a/_test/tests/inc/common_infofunctions.test.php b/_test/tests/inc/common_basicinfo.test.php
index 2e383ef8b..2e383ef8b 100644
--- a/_test/tests/inc/common_infofunctions.test.php
+++ b/_test/tests/inc/common_basicinfo.test.php
diff --git a/_test/tests/inc/common_mediainfo.test.php b/_test/tests/inc/common_mediainfo.test.php
new file mode 100644
index 000000000..0e67fbcd9
--- /dev/null
+++ b/_test/tests/inc/common_mediainfo.test.php
@@ -0,0 +1,49 @@
+<?php
+
+class common_basicinfo_test extends DokuWikiTest {
+
+ function setup(){
+ parent::setup();
+
+ global $USERINFO;
+ $USERINFO = array(
+ 'pass' => '179ad45c6ce2cb97cf1029e212046e81',
+ 'name' => 'Arthur Dent',
+ 'mail' => 'arthur@example.com',
+ 'grps' => array ('admin','user'),
+ );
+ $_SERVER['REMOTE_USER'] = 'testuser';
+ $_SERVER['REMOTE_ADDR'] = '1.2.3.4';
+ }
+
+ function _get_info() {
+ global $USERINFO;
+ $info = array (
+ 'isadmin' => true,
+ 'ismanager' => true,
+ 'userinfo' => $USERINFO,
+ 'perm' => 255,
+ 'namespace' => false,
+ 'ismobile' => false,
+ 'client' => 'testuser',
+ );
+
+ return $info;
+ }
+
+ /**
+ * We're interested in the extra keys for $INFO when its a media request
+ */
+ function test_mediainfo(){
+ global $NS, $IMG;
+ $NS = '';
+ $IMG = 'testimage.png';
+
+ $info = $this->_get_info();
+ $info['image'] = 'testimage.png';
+
+ $this->assertEquals(mediainfo(),$info);
+ }
+}
+
+//Setup VIM: ex: et ts=4 :