Merge branch 'feature/64-add-missing-tests' into 'develop'

Feature/64 add missing tests

Closes #64

See merge request !72
This commit is contained in:
Daniel Hürtgen 2017-04-13 12:13:29 +02:00
commit 186df67fce
4 changed files with 184 additions and 0 deletions

View file

@ -0,0 +1,60 @@
{
"files": {
"InputFileForIssues.php": {
"errors": 0,
"messages": [
{
"column": 9,
"fixable": false,
"line": 22,
"message": "Legacy calls are not allowed; found constant PATH_tslib. Removed in 7.0. The folder and constant no longer exist. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-61459-RemovalTslib.html",
"severity": 5,
"source": "Typo3Update.Removed.GenericConstantUsage.PATH_tslib",
"type": "WARNING"
},
{
"column": 11,
"fixable": false,
"line": 23,
"message": "Legacy calls are not allowed; found constant TYPO3_MOD_PATH. Removed in 7.4. It is required to route modules through typo3/mod.php from now on in case the module relies on the definition of those constants. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.4/Breaking-67987-RemovedEntryScriptHandling.html",
"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": 5
}
},
"totals": {
"errors": 0,
"fixable": 0,
"warnings": 5
}
}

View file

@ -0,0 +1,29 @@
<?php
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
$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';

View file

@ -0,0 +1,60 @@
{
"files": {
"InputFileForIssues.php": {
"errors": 0,
"messages": [
{
"column": 41,
"fixable": false,
"line": 24,
"message": "Legacy calls are not allowed; found \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::loadTCA. Removed in 7.0. There is no replacement, just remove call. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-61785-LoadTcaFunctionRemoved.html",
"severity": 5,
"source": "Typo3Update.Removed.GenericFunctionCall.GeneralUtility.loadTCA",
"type": "WARNING"
},
{
"column": 17,
"fixable": false,
"line": 26,
"message": "Legacy calls are not allowed; found \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::loadTCA. Removed in 7.0. There is no replacement, just remove call. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-61785-LoadTcaFunctionRemoved.html",
"severity": 5,
"source": "Typo3Update.Removed.GenericFunctionCall.GeneralUtility.loadTCA",
"type": "WARNING"
},
{
"column": 44,
"fixable": false,
"line": 28,
"message": "Legacy calls are not allowed; found \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::loadTCA. Removed in 7.0. There is no replacement, just remove call. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-61785-LoadTcaFunctionRemoved.html",
"severity": 5,
"source": "Typo3Update.Removed.GenericFunctionCall.GeneralUtility.loadTCA",
"type": "WARNING"
},
{
"column": 8,
"fixable": false,
"line": 31,
"message": "Legacy calls are not allowed; found \\TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController->includeTCA. Removed in 7.0. Full TCA is always loaded during bootstrap in FE, the method is obsolete. If an eid script calls this method to load TCA, use \\TYPO3\\CMS\\Frontend\\Utility\\EidUtility::initTCA() instead. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-61785-FrontendTcaFunctionsRemoved.html",
"severity": 5,
"source": "Typo3Update.Removed.GenericFunctionCall.TypoScriptFrontendController.includeTCA",
"type": "WARNING"
},
{
"column": 17,
"fixable": false,
"line": 35,
"message": "Legacy calls are not allowed; found \\TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController->includeTCA. Removed in 7.0. Full TCA is always loaded during bootstrap in FE, the method is obsolete. If an eid script calls this method to load TCA, use \\TYPO3\\CMS\\Frontend\\Utility\\EidUtility::initTCA() instead. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-61785-FrontendTcaFunctionsRemoved.html",
"severity": 5,
"source": "Typo3Update.Removed.GenericFunctionCall.TypoScriptFrontendController.includeTCA",
"type": "WARNING"
}
],
"warnings": 5
}
},
"totals": {
"errors": 0,
"fixable": 0,
"warnings": 5
}
}

View file

@ -0,0 +1,35 @@
<?php
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('some_tca_table');
// Both works, as we check last part of class name only.
GeneralUtility::loadTCA('some_tca_table');
// Also matches, as we don't check whole name for now, to enable the above check with imported name.
\OwnVendor\ExtName\Utility\GeneralUtility::loadTCA('some_tca_table');
$test = new \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController();
$test->includeTCA();
$someThingElse = new \DateTime();
// Is also detected, as we do not check type of variable.
$someThingElse->includeTCA();