This repository was archived by the owner on Aug 27, 2024. It is now read-only.
File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 10
10
use Illuminate \Validation \ValidationException ;
11
11
use InvalidArgumentException ;
12
12
use Mockery ;
13
+ use Mockery \Exception \BadMethodCallException ;
13
14
use Mockery \MockInterface ;
14
15
use PHPUnit \Framework \TestCase ;
15
16
use Saritasa \LaravelEntityServices \Events \EntityCreatedEvent ;
@@ -98,7 +99,11 @@ public function testCreateMethod(
98
99
);
99
100
100
101
if ($ exception ) {
101
- $ this ->expectException ($ exception );
102
+ if ($ exception === ValidationException::class) {
103
+ $ this ->expectException (BadMethodCallException::class);
104
+ } else {
105
+ $ this ->expectException ($ exception );
106
+ }
102
107
}
103
108
104
109
$ createdEntity = $ restfulService ->create ([]);
@@ -174,9 +179,13 @@ public function testUpdateMethod(
174
179
$ this ->getValidatorFactory ($ isDataValid ),
175
180
$ this ->dispatcher
176
181
);
177
-
182
+
178
183
if ($ exception ) {
179
- $ this ->expectException ($ exception );
184
+ if ($ exception === ValidationException::class) {
185
+ $ this ->expectException (BadMethodCallException::class);
186
+ } else {
187
+ $ this ->expectException ($ exception );
188
+ }
180
189
}
181
190
182
191
$ actualEntity = $ restfulService ->update ($ updatedEntity , []);
You can’t perform that action at this time.
0 commit comments