File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ class Builder extends \Illuminate\Database\Query\Builder {
20
20
protected $ conversion = array (
21
21
'= ' => '= ' ,
22
22
'!= ' => '$ne ' ,
23
+ '<> ' => '$ne ' ,
23
24
'< ' => '$lt ' ,
24
25
'<= ' => '$lte ' ,
25
26
'> ' => '$gt ' ,
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ public function testUpdate()
66
66
$ check ->save ();
67
67
68
68
$ this ->assertEquals (true , $ check ->exists );
69
- $ this ->assertInstanceOf ('DateTime ' , $ user ->created_at );
69
+ $ this ->assertInstanceOf ('DateTime ' , $ check ->created_at );
70
70
$ this ->assertInstanceOf ('DateTime ' , $ check ->updated_at );
71
71
$ this ->assertEquals (1 , User::count ());
72
72
@@ -185,7 +185,6 @@ public function testSoftDelete()
185
185
$ this ->assertEquals (true , $ user ->exists );
186
186
187
187
$ user ->delete ();
188
- $ this ->assertEquals (false , $ user ->exists );
189
188
190
189
$ check = Soft::find ($ user ->_id );
191
190
$ this ->assertEquals (null , $ check );
@@ -195,6 +194,14 @@ public function testSoftDelete()
195
194
196
195
$ all = Soft::withTrashed ()->get ();
197
196
$ this ->assertEquals (1 , $ all ->count ());
197
+
198
+ $ check = $ all [0 ];
199
+ $ this ->assertInstanceOf ('DateTime ' , $ check ->deleted_at );
200
+ $ this ->assertEquals (true , $ check ->trashed ());
201
+
202
+ $ check ->restore ();
203
+ $ all = Soft::get ();
204
+ $ this ->assertEquals (1 , $ all ->count ());
198
205
}
199
206
200
207
}
Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ public function testWhere()
61
61
62
62
$ users = User::where ('age ' , '!= ' , 35 )->get ();
63
63
$ this ->assertEquals (6 , count ($ users ));
64
+
65
+ $ users = User::where ('age ' , '<> ' , 35 )->get ();
66
+ $ this ->assertEquals (6 , count ($ users ));
64
67
}
65
68
66
69
public function testAndWhere ()
You can’t perform that action at this time.
0 commit comments