Skip to content

Commit 11c2a6d

Browse files
author
Westin Shafer
committed
Updated readme and sql test
1 parent e9797e5 commit 11c2a6d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Same if you want different settings per entity/table, it should be done by a spe
1818
- [With simple SQL](#with-sql-applicator)
1919
- [Supported filters](#supported-filters)
2020
- [Equals](#equals---eq-)
21+
- [Not Equals](#not-equals---neq-)
2122
- [Greater than](#greater-than---gt-)
2223
- [Greater than or Equals](#greater-than-or-equals---gte-)
2324
- [Lower than](#lower-than---lt-)
@@ -153,6 +154,11 @@ GET http://host/endpoint/?field=value
153154
```
154155
_Both examples ☝ are equal_
155156

157+
### Not Equals - NEQ (!=)
158+
```http request
159+
GET http://host/endpoint/?field[neq]=value
160+
```
161+
156162
### Greater Than - GT (>)
157163
```http request
158164
GET http://host/endpoint/?field[gt]=value

tests/Service/FilterApplicatorTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ public function provideFilter(): array
100100
'SELECT * FROM table WHERE public = 1 AND col = :col_eq',
101101
['col_eq' => 'val'],
102102
],
103+
'sql - neq' => [
104+
$sqlApplicator,
105+
[new FilterWithOperator('col', new Value('val'), '!=', 'neq')],
106+
'SELECT * FROM table WHERE public != 1',
107+
'SELECT * FROM table WHERE public != 1 AND col != :col_neq',
108+
['col_neq' => 'val'],
109+
],
103110
'sql - gt' => [
104111
$sqlApplicator,
105112
[new FilterWithOperator('col', new Value('val'), '>', 'gt')],

0 commit comments

Comments
 (0)