Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassReferenceNameCasingFixer - Add missing test cases for catch #6270

Merged
merged 1 commit into from Feb 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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) {}',
];
}
}