summaryrefslogtreecommitdiff
path: root/_test/tests/inc/input.test.php
diff options
context:
space:
mode:
Diffstat (limited to '_test/tests/inc/input.test.php')
-rw-r--r--_test/tests/inc/input.test.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/_test/tests/inc/input.test.php b/_test/tests/inc/input.test.php
index 761b7ddbc..59b5ea4b9 100644
--- a/_test/tests/inc/input.test.php
+++ b/_test/tests/inc/input.test.php
@@ -12,7 +12,8 @@ class input_test extends DokuWikiTest {
'zero' => '0',
'one' => '1',
'empty' => '',
- 'emptya' => array()
+ 'emptya' => array(),
+ 'do' => array('save' => 'Speichern'),
);
public function test_str() {
@@ -213,4 +214,20 @@ class input_test extends DokuWikiTest {
$this->assertEquals('bla',$test);
}
+ public function test_extract(){
+ $_REQUEST = $this->data;
+ $_POST = $this->data;
+ $_GET = $this->data;
+ $INPUT = new Input();
+
+ $this->assertEquals('save', $INPUT->extract('do')->str('do'));
+ $this->assertEquals('', $INPUT->extract('emptya')->str('emptya'));
+ $this->assertEquals('foo', $INPUT->extract('string')->str('string'));
+ $this->assertEquals('foo', $INPUT->extract('array')->str('array'));
+
+ $this->assertEquals('save', $INPUT->post->extract('do')->str('do'));
+ $this->assertEquals('', $INPUT->post->extract('emptya')->str('emptya'));
+ $this->assertEquals('foo', $INPUT->post->extract('string')->str('string'));
+ $this->assertEquals('foo', $INPUT->post->extract('array')->str('array'));
+ }
}