summaryrefslogtreecommitdiff
path: root/tests/units/Core/CsvTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/Core/CsvTest.php')
-rw-r--r--tests/units/Core/CsvTest.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/units/Core/CsvTest.php b/tests/units/Core/CsvTest.php
new file mode 100644
index 00000000..1534584e
--- /dev/null
+++ b/tests/units/Core/CsvTest.php
@@ -0,0 +1,22 @@
+<?php
+
+require_once __DIR__.'/../Base.php';
+
+use Core\Csv;
+
+class CsvTest extends Base
+{
+ public function testGetBooleanValue()
+ {
+ $this->assertEquals(1, Csv::getBooleanValue('1'));
+ $this->assertEquals(1, Csv::getBooleanValue('True'));
+ $this->assertEquals(1, Csv::getBooleanValue('t'));
+ $this->assertEquals(1, Csv::getBooleanValue('TRUE'));
+ $this->assertEquals(1, Csv::getBooleanValue('true'));
+ $this->assertEquals(1, Csv::getBooleanValue('T'));
+
+ $this->assertEquals(0, Csv::getBooleanValue('0'));
+ $this->assertEquals(0, Csv::getBooleanValue('123'));
+ $this->assertEquals(0, Csv::getBooleanValue('anything'));
+ }
+}