File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,10 @@ public function testModelAlreadyExists()
1616 {
1717 $ this ->mockGeneratorForExistingModel ();
1818
19- $ this ->expectException (ClassAlreadyExistsException::class);
20- $ this ->expectExceptionMessage ('Cannot create Post Model cause Post Model already exists. Remove Post Model. ' );
19+ $ this ->assertExceptionThrew (
20+ className: ClassAlreadyExistsException::class,
21+ message: 'Cannot create Post Model cause Post Model already exists. Remove Post Model. ' ,
22+ );
2123
2224 app (ModelGenerator::class)
2325 ->setModel ('Post ' )
@@ -26,9 +28,11 @@ public function testModelAlreadyExists()
2628
2729 public function testRelationModelMissing ()
2830 {
29- $ this ->expectException (ClassNotExistsException::class);
30- $ this ->expectExceptionMessage ("Cannot create Post Model cause relation model Comment does not exist. "
31- . "Create the Comment Model by himself or run command 'php artisan make:entity Comment --only-model'. " );
31+ $ this ->assertExceptionThrew (
32+ className: ClassNotExistsException::class,
33+ message: "Cannot create Post Model cause relation model Comment does not exist. "
34+ . "Create the Comment Model by himself or run command 'php artisan make:entity Comment --only-model'. " ,
35+ );
3236
3337 app (ModelGenerator::class)
3438 ->setModel ('Post ' )
You can’t perform that action at this time.
0 commit comments