Completed
Push — master ( db33ac...af29ce )
by WEBEWEB
02:54 queued 11s
created

BooleanUtilityTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of the core-library package.
5
 *
6
 * (c) 2017 NdC/WBW
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Core\Tests\Utility;
13
14
use PHPUnit_Framework_TestCase;
15
use WBW\Library\Core\Utility\BooleanUtility;
16
17
/**
18
 * Boolean utility test.
19
 *
20
 * @author NdC/WBW <https://github.com/webeweb/>
21
 * @package WBW\Library\Core\Tests\Utility
22
 * @final
23
 */
24
final class BooleanUtilityTest extends PHPUnit_Framework_TestCase {
25
26
	/**
27
	 * Tests the parseString() method.
28
	 *
29
	 * @return void
30
	 */
31
	public function testParseString() {
32
33
		$this->assertEquals(false, BooleanUtility::parseString(null));
34
		$this->assertEquals(false, BooleanUtility::parseString(""));
35
		$this->assertEquals(true, BooleanUtility::parseString("1"));
36
		$this->assertEquals(true, BooleanUtility::parseString("O"));
37
		$this->assertEquals(true, BooleanUtility::parseString("o"));
38
		$this->assertEquals(true, BooleanUtility::parseString("OK"));
39
		$this->assertEquals(true, BooleanUtility::parseString("ok"));
40
		$this->assertEquals(true, BooleanUtility::parseString("OUI"));
41
		$this->assertEquals(true, BooleanUtility::parseString("oui"));
42
		$this->assertEquals(true, BooleanUtility::parseString("TRUE"));
43
		$this->assertEquals(true, BooleanUtility::parseString("true"));
44
		$this->assertEquals(true, BooleanUtility::parseString("Y"));
45
		$this->assertEquals(true, BooleanUtility::parseString("y"));
46
		$this->assertEquals(true, BooleanUtility::parseString("YES"));
47
		$this->assertEquals(true, BooleanUtility::parseString("yes"));
48
	}
49
50
}
51