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.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/_test/tests/inc/input.test.php b/_test/tests/inc/input.test.php
index 627af3a2b..761b7ddbc 100644
--- a/_test/tests/inc/input.test.php
+++ b/_test/tests/inc/input.test.php
@@ -95,6 +95,11 @@ class input_test extends DokuWikiTest {
$this->assertSame(1, $INPUT->get->int('get', false));
$this->assertSame(0, $INPUT->int('array'));
+
+ $this->assertSame(0, $INPUT->int('zero', -1));
+ $this->assertSame(-1, $INPUT->int('empty', -1));
+ $this->assertSame(-1, $INPUT->int('zero', -1, true));
+ $this->assertSame(-1, $INPUT->int('empty', -1, true));
}
public function test_arr() {
@@ -155,6 +160,11 @@ class input_test extends DokuWikiTest {
$this->assertSame(false, $INPUT->post->bool('get'));
$this->assertSame(true, $INPUT->post->bool('post'));
+
+ $this->assertSame(false, $INPUT->bool('zero', -1));
+ $this->assertSame(-1, $INPUT->bool('empty', -1));
+ $this->assertSame(-1, $INPUT->bool('zero', -1, true));
+ $this->assertSame(-1, $INPUT->bool('empty', -1, true));
}
public function test_remove() {
@@ -203,4 +213,4 @@ class input_test extends DokuWikiTest {
$this->assertEquals('bla',$test);
}
-} \ No newline at end of file
+}