@@ -60,6 +60,15 @@ public function testMatch()
60
60
'val ' => 10 ,
61
61
]
62
62
),
63
+
64
+ $ row5 = new Row (
65
+ [
66
+ 'id ' => 5 ,
67
+ 'field ' => 'ab ' ,
68
+ 'field2 ' => 'ba ' ,
69
+ 'val ' => null ,
70
+ ]
71
+ ),
63
72
];
64
73
65
74
$ this ->assertEquals ($ collection , $ this ->object ->match ($ collection ));
@@ -86,7 +95,7 @@ public function testMatch()
86
95
// Test Less Than
87
96
$ this ->object = new IteratorFilter ();
88
97
$ this ->object ->and ('val ' , Relation::LESS_THAN , 50 );
89
- $ this ->assertEquals ([$ row3 , $ row4 ], $ this ->object ->match ($ collection ));
98
+ $ this ->assertEquals ([$ row3 , $ row4, $ row5 ], $ this ->object ->match ($ collection ));
90
99
91
100
// Test Greater or Equal Than
92
101
$ this ->object = new IteratorFilter ();
@@ -96,12 +105,12 @@ public function testMatch()
96
105
// Test Less or Equal Than
97
106
$ this ->object = new IteratorFilter ();
98
107
$ this ->object ->and ('val ' , Relation::LESS_OR_EQUAL_THAN , 50 );
99
- $ this ->assertEquals ([$ row1 , $ row3 , $ row4 ], $ this ->object ->match ($ collection ));
108
+ $ this ->assertEquals ([$ row1 , $ row3 , $ row4, $ row5 ], $ this ->object ->match ($ collection ));
100
109
101
110
// Test Not Equal
102
111
$ this ->object = new IteratorFilter ();
103
112
$ this ->object ->and ('val ' , Relation::NOT_EQUAL , 50 );
104
- $ this ->assertEquals ([$ row2 , $ row3 , $ row4 ], $ this ->object ->match ($ collection ));
113
+ $ this ->assertEquals ([$ row2 , $ row3 , $ row4, $ row5 ], $ this ->object ->match ($ collection ));
105
114
106
115
// Test Starts With
107
116
$ this ->object = new IteratorFilter ();
@@ -121,7 +130,17 @@ public function testMatch()
121
130
// Test Not In
122
131
$ this ->object = new IteratorFilter ();
123
132
$ this ->object ->and ('val ' , Relation::NOT_IN , [10 , 30 , 50 ]);
124
- $ this ->assertEquals ([$ row2 ], $ this ->object ->match ($ collection ));
133
+ $ this ->assertEquals ([$ row2 , $ row5 ], $ this ->object ->match ($ collection ));
134
+
135
+ // Test Is Null
136
+ $ this ->object = new IteratorFilter ();
137
+ $ this ->object ->and ('val ' , Relation::IS_NULL );
138
+ $ this ->assertEquals ([$ row5 ], $ this ->object ->match ($ collection ));
139
+
140
+ // Test Is Not Null
141
+ $ this ->object = new IteratorFilter ();
142
+ $ this ->object ->and ('val ' , Relation::IS_NOT_NULL );
143
+ $ this ->assertEquals ([$ row1 , $ row2 , $ row3 , $ row4 ], $ this ->object ->match ($ collection ));
125
144
}
126
145
127
146
0 commit comments