@@ -34,7 +34,10 @@ final class WhitespacesFixerConfigTest extends TestCase
3434 public function testCases ($ indent , $ lineEnding , $ exceptionRegExp = null )
3535 {
3636 if (null !== $ exceptionRegExp ) {
37- $ this ->setExpectedExceptionRegExp (\InvalidArgumentException::class, $ exceptionRegExp );
37+ $ this ->setExpectedExceptionRegExp (
38+ \InvalidArgumentException::class,
39+ '%^ ' .preg_quote ($ exceptionRegExp , '% ' ).'$% '
40+ );
3841 }
3942
4043 $ config = new WhitespacesFixerConfig ($ indent , $ lineEnding );
@@ -50,10 +53,10 @@ public function provideTestCases()
5053 ["\t" , "\n" ],
5154 [' ' , "\r\n" ],
5255 ["\t" , "\r\n" ],
53- [' ' , 'asd ' , '/ lineEnding/ ' ],
54- [' ' , [], '/ lineEnding/ ' ],
55- ['std ' , "\n" , '/ indent/ ' ],
56- [[], "\n" , '/ indent/ ' ],
56+ [' ' , 'asd ' , 'Invalid " lineEnding" param, expected "\n" or "\r\n". ' ],
57+ [' ' , [], 'Invalid " lineEnding" param, expected "\n" or "\r\n". ' ],
58+ ['std ' , "\n" , 'Invalid " indent" param, expected tab or two or four spaces. ' ],
59+ [[], "\n" , 'Invalid " indent" param, expected tab or two or four spaces. ' ],
5760 ];
5861 }
5962}
0 commit comments