diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff/Expected.json b/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff/Expected.json index 6e63f1d..e3072f3 100644 --- a/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff/Expected.json +++ b/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff/Expected.json @@ -20,14 +20,41 @@ "severity": 5, "source": "Typo3Update.Removed.GenericConstantUsage.TYPO3_MOD_PATH", "type": "WARNING" + }, + { + "column": 75, + "fixable": false, + "line": 24, + "message": "Legacy calls are not allowed; found constant \\TYPO3\\CMS\\IndexedSearch\\Controller\\SearchFormController::WILDCARD_LEFT. Removed in 7.6. Use \\TYPO3\\CMS\\IndexedSearch\\Utility\\LikeWildcard::LEFT instead. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.6/Breaking-69227-StringsForLikeAreNotProperlyEscaped.html", + "severity": 5, + "source": "Typo3Update.Removed.GenericConstantUsage.SearchFormController.WILDCARD_LEFT", + "type": "WARNING" + }, + { + "column": 39, + "fixable": false, + "line": 27, + "message": "Legacy calls are not allowed; found constant \\TYPO3\\CMS\\IndexedSearch\\Controller\\SearchFormController::WILDCARD_LEFT. Removed in 7.6. Use \\TYPO3\\CMS\\IndexedSearch\\Utility\\LikeWildcard::LEFT instead. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.6/Breaking-69227-StringsForLikeAreNotProperlyEscaped.html", + "severity": 5, + "source": "Typo3Update.Removed.GenericConstantUsage.SearchFormController.WILDCARD_LEFT", + "type": "WARNING" + }, + { + "column": 66, + "fixable": false, + "line": 29, + "message": "Legacy calls are not allowed; found constant \\TYPO3\\CMS\\IndexedSearch\\Controller\\SearchFormController::WILDCARD_LEFT. Removed in 7.6. Use \\TYPO3\\CMS\\IndexedSearch\\Utility\\LikeWildcard::LEFT instead. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.6/Breaking-69227-StringsForLikeAreNotProperlyEscaped.html", + "severity": 5, + "source": "Typo3Update.Removed.GenericConstantUsage.SearchFormController.WILDCARD_LEFT", + "type": "WARNING" } ], - "warnings": 2 + "warnings": 5 } }, "totals": { "errors": 0, "fixable": 0, - "warnings": 2 + "warnings": 5 } } diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff/InputFileForIssues.php b/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff/InputFileForIssues.php index 944af55..1a199ae 100644 --- a/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff/InputFileForIssues.php +++ b/tests/Fixtures/Standards/Typo3Update/Sniffs/Removed/GenericConstantUsageSniff/InputFileForIssues.php @@ -21,3 +21,9 @@ $file = PATH_tslib . 'something.php'; $module = TYPO3_MOD_PATH . '/folder'; +$someVariable = \TYPO3\CMS\IndexedSearch\Controller\SearchFormController::WILDCARD_LEFT . '/folder'; +use \TYPO3\CMS\IndexedSearch\Controller\SearchFormController; +// Will work, as we only check last part of class name. +$someVariable = SearchFormController::WILDCARD_LEFT . '/folder'; +// Also matches, as we don't check whole name for now, to enable the above check with imported name. +$someVariable = \Vendor\ExtName\Controller\SearchFormController::WILDCARD_LEFT . '/folder';