@@ -18,8 +18,8 @@ protected function setUp(): void
1818
1919 public  function  testSetCassettePathThrowsErrorOnInvalidPath (): void 
2020 {
21-  $ this expectException (
22-   VCRException::class, 
21+  $ this expectException (VCRException::class); 
22+  $ this -> expectExceptionMessage ( 
2323 "Cassette path 'invalid_path' is not a directory. Please either  " 
2424 .'create it or set a different cassette path using  ' 
2525 ."\\VCR \\VCR::configure()->setCassettePath('directory'). " 
@@ -63,7 +63,8 @@ public function testEnableSingleLibraryHook(): void
6363
6464 public  function  testEnableLibraryHooksFailsWithWrongHookName (): void 
6565 {
66-  $ this expectException ('InvalidArgumentException ' , "Library hooks don't exist: non_existing " );
66+  $ this expectException (\InvalidArgumentException::class);
67+  $ this expectExceptionMessage ("Library hooks don't exist: non_existing " );
6768 $ this config ->enableLibraryHooks (['non_existing ' ]);
6869 }
6970
@@ -81,13 +82,15 @@ public function testEnableRequestMatchers(): void
8182
8283 public  function  testEnableRequestMatchersFailsWithNoExistingName (): void 
8384 {
84-  $ this expectException ('InvalidArgumentException ' , "Request matchers don't exist: wrong, name " );
85+  $ this expectException (\InvalidArgumentException::class);
86+  $ this expectExceptionMessage ("Request matchers don't exist: wrong, name " );
8587 $ this config ->enableRequestMatchers (['wrong ' , 'name ' ]);
8688 }
8789
8890 public  function  testAddRequestMatcherFailsWithNoName (): void 
8991 {
90-  $ this expectException ('VCR\VCRException ' , "A request matchers name must be at least one character long. Found '' " );
92+  $ this expectException (\VCR \VCRException::class);
93+  $ this expectExceptionMessage ("A request matchers name must be at least one character long. Found '' " );
9194 $ expectedfunction  ($ first$ second
9295 return  true ;
9396 };
@@ -122,7 +125,8 @@ public function availableStorageProvider()
122125
123126 public  function  testSetStorageInvalidName (): void 
124127 {
125-  $ this expectException ('VCR\VCRException ' , "Storage 'Does not exist' not available. " );
128+  $ this expectException (\VCR \VCRException::class);
129+  $ this expectExceptionMessage ("Storage 'Does not exist' not available. " );
126130 $ this config ->setStorage ('Does not exist ' );
127131 }
128132
@@ -154,7 +158,8 @@ public function testBlacklist(): void
154158
155159 public  function  testSetModeInvalidName (): void 
156160 {
157-  $ this expectException ('VCR\VCRException ' , "Mode 'invalid' does not exist. " );
161+  $ this expectException (\VCR \VCRException::class);
162+  $ this expectExceptionMessage ("Mode 'invalid' does not exist. " );
158163 $ this config ->setMode ('invalid ' );
159164 }
160165}
0 commit comments