@@ -17,6 +17,27 @@ public function testNumeric()
17
17
$ this ->assertSame ('test:10 ' , (string )$ filter );
18
18
}
19
19
20
+ public function testIntString ()
21
+ {
22
+ $ filter = new Filter ();
23
+ $ filter ->setName ('test ' )->setValue ('10 ' );
24
+ $ this ->assertSame ('test:"10" ' , (string )$ filter );
25
+ }
26
+
27
+ public function testIntStringArray ()
28
+ {
29
+ $ filter = new Filter ('array ' );
30
+ $ filter ->setName ('test ' )->setValue (['1 ' , '2 ' , '3 ' ]);
31
+ $ this ->assertSame ('test:"1","2","3" ' , (string )$ filter );
32
+ }
33
+
34
+ public function testFloatStringArray ()
35
+ {
36
+ $ filter = new Filter ('array ' );
37
+ $ filter ->setName ('test ' )->setValue (['1.1 ' , '2.2 ' , '3.3 ' ]);
38
+ $ this ->assertSame ('test:"1.1","2.2","3.3" ' , (string )$ filter );
39
+ }
40
+
20
41
public function testDefaultType ()
21
42
{
22
43
$ filter = new Filter ();
@@ -38,13 +59,20 @@ public function testString()
38
59
$ this ->assertSame ('test:"key" as foo ' , (string )$ filter );
39
60
}
40
61
41
- public function testArray ()
62
+ public function testIntArray ()
42
63
{
43
64
$ filter = new Filter ('array ' );
44
- $ filter ->setName ('test ' )->setValue ([1 ,2 , 3 ])->setAlias ('foo ' );
65
+ $ filter ->setName ('test ' )->setValue ([1 , 2 , 3 ])->setAlias ('foo ' );
45
66
$ this ->assertSame ('test:1,2,3 as foo ' , (string )$ filter );
46
67
}
47
68
69
+ public function testFloatArray ()
70
+ {
71
+ $ filter = new Filter ('array ' );
72
+ $ filter ->setName ('test ' )->setValue ([1.1 , 2.2 , 3.3 ])->setAlias ('foo ' );
73
+ $ this ->assertSame ('test:1.1,2.2,3.3 as foo ' , (string )$ filter );
74
+ }
75
+
48
76
public function testSingleStringInArray ()
49
77
{
50
78
$ filter = new Filter ('array ' );
@@ -63,4 +91,18 @@ public function testRange()
63
91
$ filter ->setName ('test ' )->setValue ($ filterRangeCollection )->setAlias ('foo ' );
64
92
$ this ->assertSame ('test:range(1 to 10),(11 to 20) as foo ' , (string )$ filter );
65
93
}
94
+
95
+ public function testBoolTrue ()
96
+ {
97
+ $ filter = new Filter ('bool ' );
98
+ $ filter ->setName ('test ' )->setValue (true );
99
+ $ this ->assertSame ('test:true ' , (string )$ filter );
100
+ }
101
+
102
+ public function testBoolFalse ()
103
+ {
104
+ $ filter = new Filter ('bool ' );
105
+ $ filter ->setName ('test ' )->setValue (false );
106
+ $ this ->assertSame ('test:false ' , (string )$ filter );
107
+ }
66
108
}
0 commit comments