Просмотр исходного кода

minor #6270 ClassReferenceNameCasingFixer - Add missing test cases for catch (SpacePossum)

This PR was merged into the master branch.

Discussion
----------

ClassReferenceNameCasingFixer - Add missing test cases for catch

Commits
-------

9e31f1fc3 ClassReferenceNameCasingFixer - Add missing test cases for catch
SpacePossum 3 лет назад
Родитель
Сommit
a6fa961b7e
1 измененных файлов с 15 добавлено и 0 удалено
  1. 15 0
      tests/Fixer/Casing/ClassReferenceNameCasingFixerTest.php

+ 15 - 0
tests/Fixer/Casing/ClassReferenceNameCasingFixerTest.php

@@ -176,6 +176,11 @@ namespace Foo {
             '<?php use Exception as baR;',
             '<?php use exception as baR;',
         ];
+
+        yield [
+            '<?php try { foo(); } catch(\LogicException $e) {}',
+            '<?php try { foo(); } catch(\logicexception $e) {}',
+        ];
     }
 
     /**
@@ -198,5 +203,15 @@ namespace Foo {
                 case exception;
             }',
         ];
+
+        yield 'multiple type catch with variable' => [
+            '<?php try { foo(); } catch(\InvalidArgumentException|\LogicException $e) {}',
+            '<?php try { foo(); } catch(\INVALIDARGUMENTEXCEPTION|\logicexception $e) {}',
+        ];
+
+        yield 'multiple type catch without variable 3' => [
+            '<?php try { foo(); } catch(\InvalidArgumentException|\LogicException) {}',
+            '<?php try { foo(); } catch(\INVALIDARGUMENTEXCEPTION|\logicexception) {}',
+        ];
     }
 }