File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file. This projec
8
8
- Dependency ` symfony/psr-http-message-bridge ` now allows ` ^1.0 ` as version 1 has now been released. Version ` 0.2.* ` is
9
9
still allowed to maintain backwards compatibility but will be removed in ` v0.6 ` of this package.
10
10
11
+ ### Fixed
12
+ - Amended testing that a model has been trashed so that it is compatible with Laravel 5.2 and 5.3.
13
+
11
14
## [ 0.5.0] - 2016-10-21
12
15
13
16
This release is the first release to support Laravel 5.3.
Original file line number Diff line number Diff line change @@ -111,7 +111,12 @@ protected function assertModelDeleted(Model $model)
111
111
*/
112
112
protected function assertModelTrashed (Model $ model )
113
113
{
114
- PHPUnit::assertNull ($ model ->fresh (), 'Model is not trashed. ' );
114
+ /** Cannot use `fresh()` because it is different between 5.2 and 5.3. */
115
+ $ fresh = $ model ->newQueryWithoutScopes ()->where ($ model ->getKeyName (), $ model ->getKey ())->first ();
116
+
117
+ PHPUnit::assertNotNull ($ fresh , 'Model has been removed from the database. ' );
118
+ PHPUnit::assertTrue ($ fresh ->trashed (), 'Model is not trashed. ' );
119
+
115
120
return $ this ->seeModelInDatabase ($ model , [$ model ->getKeyName () => $ model ->getKey ()]);
116
121
}
117
122
You can’t perform that action at this time.
0 commit comments