File tree Expand file tree Collapse file tree 1 file changed +34
-3
lines changed Expand file tree Collapse file tree 1 file changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -12,21 +12,24 @@ class FilterTest extends TestCase
1212 'problem ' => '1 ' ,
1313 'service ' => 'ping ' ,
1414 'state ' => 2 ,
15- 'handled ' => '1 '
15+ 'handled ' => '1 ' ,
16+ 'host_id ' => 1
1617 ],
1718 [
1819 'host ' => 'localhost ' ,
1920 'problem ' => '1 ' ,
2021 'service ' => 'www.icinga.com ' ,
2122 'state ' => 0 ,
22- 'handled ' => '0 '
23+ 'handled ' => '0 ' ,
24+ 'host_id ' => null
2325 ],
2426 [
2527 'host ' => 'localhost ' ,
2628 'problem ' => '1 ' ,
2729 'service ' => 'www.icinga.com ' ,
2830 'state ' => 1 ,
29- 'handled ' => '0 '
31+ 'handled ' => '0 ' ,
32+ 'host_id ' => 1
3033 ]
3134 ];
3235
@@ -183,6 +186,34 @@ public function testUnequalMatchesMultiValuedColumns()
183186 ]));
184187 }
185188
189+ public function testHasValueMatches ()
190+ {
191+ $ hasValue = Filter::hasValue ('host_id ' );
192+
193+ $ this ->assertTrue (Filter::match ($ hasValue , $ this ->row (0 )));
194+ }
195+
196+ public function testHasValueMismatches ()
197+ {
198+ $ hasValue = Filter::hasValue ('host_id ' );
199+
200+ $ this ->assertFalse (Filter::match ($ hasValue , $ this ->row (1 )));
201+ }
202+
203+ public function testHasNotValueMatches ()
204+ {
205+ $ hasNotValue = Filter::hasNotValue ('host_id ' );
206+
207+ $ this ->assertTrue (Filter::match ($ hasNotValue , $ this ->row (1 )));
208+ }
209+
210+ public function testHasNotValueMismatches ()
211+ {
212+ $ hasNotValue = Filter::hasNotValue ('host_id ' );
213+
214+ $ this ->assertFalse (Filter::match ($ hasNotValue , $ this ->row (0 )));
215+ }
216+
186217 public function testGreaterThanMatches ()
187218 {
188219 $ greaterThan = Filter::greaterThan ('state ' , 1 );
You can’t perform that action at this time.
0 commit comments