From b32fc01110999e112e3d990e9f9b870aa5d44bf3 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 9 May 2017 10:55:17 +0200 Subject: [PATCH] TASK: Add test for TypeHintCatchExceptionSniff * Check that the sniff works with new feature of removed extension. Relates: #44 --- .../TypeHintCatchExceptionSniff/Expected.json | 13 +++++++++++-- .../InputFileForIssues.php | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff/Expected.json b/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff/Expected.json index 59701dd..0094c2d 100644 --- a/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff/Expected.json +++ b/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff/Expected.json @@ -20,14 +20,23 @@ "severity": 5, "source": "Typo3Update.Classname.TypeHintCatchException.legacyClassname", "type": "ERROR" + }, + { + "column": 11, + "fixable": false, + "line": 48, + "message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html", + "severity": 5, + "source": "Typo3Update.Classname.TypeHintCatchException.RemovedClass.perm", + "type": "WARNING" } ], - "warnings": 0 + "warnings": 1 } }, "totals": { "errors": 2, "fixable": 2, - "warnings": 0 + "warnings": 1 } } diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff/InputFileForIssues.php b/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff/InputFileForIssues.php index 0ea392d..28e47f6 100644 --- a/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff/InputFileForIssues.php +++ b/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/TypeHintCatchExceptionSniff/InputFileForIssues.php @@ -42,3 +42,9 @@ try { } catch (TYPO3\CMS\Extbase\Exception $e) { // else } + +try { + // something +} catch (\TYPO3\CMS\Perm\Controller\PermissionAjaxController $e) { + // else +}