Skip to content

Commit

Permalink
minor #6270 ClassReferenceNameCasingFixer - Add missing test cases fo…
Browse files Browse the repository at this point in the history
…r catch (SpacePossum)

This PR was merged into the master branch.

Discussion
----------

ClassReferenceNameCasingFixer - Add missing test cases for catch

Commits
-------

9e31f1f ClassReferenceNameCasingFixer - Add missing test cases for catch
  • Loading branch information
SpacePossum committed Feb 5, 2022
2 parents 42a449a + 9e31f1f commit a6fa961
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Fixer/Casing/ClassReferenceNameCasingFixerTest.php
Expand Up @@ -176,6 +176,11 @@ public function provideFixCases(): \Generator
'<?php use Exception as baR;',
'<?php use exception as baR;',
];

yield [
'<?php try { foo(); } catch(\LogicException $e) {}',
'<?php try { foo(); } catch(\logicexception $e) {}',
];
}

/**
Expand All @@ -198,5 +203,15 @@ public function provideFix81Cases(): \Generator
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) {}',
];
}
}

0 comments on commit a6fa961

Please sign in to comment.