summaryrefslogtreecommitdiff
path: root/tests/units/Core/CsvTest.php
blob: 1534584ef0dfd9ee6d88b864e1f4360e442221be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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'));
    }
}