From 00666766dfec5b13ab1f27dd3425ad7b73e8775b Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Thu, 8 Aug 2019 01:44:15 +0200 Subject: [PATCH] [TASK] Drop the BE module (#118) --- CHANGELOG.md | 1 + Classes/AbstractDataContainer.php | 113 -- Classes/BackEnd/Ajax.php | 85 -- Classes/BackEnd/Module.php | 1008 ----------------- Classes/BackEnd/Request.php | 56 - Classes/BackEnd/TestListener.php | 629 ---------- Classes/BackEnd/conf.php | 8 - Classes/BackEnd/index.php | 64 -- Classes/Exception/NoTestsDirectory.php | 12 - Classes/Interface/ConvertService.php | 66 -- .../Interface/ExtensionSettingsService.php | 13 - Classes/Interface/Request.php | 41 - Classes/Interface/UserSettingsService.php | 22 - Classes/Service/ExtensionSettingsService.php | 59 - Classes/Service/FakeOutputService.php | 63 -- Classes/Service/OutputService.php | 35 - Classes/Service/TestCaseService.php | 205 ---- Classes/Service/TestFinder.php | 292 ----- Classes/Service/UserSettingsService.php | 85 -- Classes/Testable.php | 259 ----- Classes/TestingDataContainer.php | 51 - .../AbstractSelectorViewHelper.php | 104 -- Classes/ViewHelpers/AbstractTagViewHelper.php | 53 - Classes/ViewHelpers/AbstractViewHelper.php | 59 - Classes/ViewHelpers/CheckboxViewHelper.php | 113 -- .../ExtensionSelectorViewHelper.php | 173 --- Classes/ViewHelpers/ProgressBarViewHelper.php | 23 - .../Introduction/WhatDoesItDo/Index.rst | 5 +- .../UsersManual/Installation/Index.rst | 34 +- .../Private/Language/da.locallang_backend.xlf | 110 -- .../Private/Language/de.locallang_backend.xlf | 119 -- .../Private/Language/locallang_backend.xlf | 119 -- Resources/Public/CSS/BackEnd.css | 177 --- Resources/Public/Icons/BackEndModule.png | Bin 1686 -> 0 bytes Resources/Public/Icons/Runner.gif | Bin 960 -> 0 bytes Resources/Public/Icons/RunnerRunning.gif | Bin 839 -> 0 bytes Resources/Public/JavaScript/BackEnd.js | 205 ---- TestExtensions/aaa/Tests/Unit/OneTest.php | 12 - .../aaa/Tests/Unit/fixtures/AnotherTest.php | 12 - TestExtensions/aaa/composer.json | 12 - TestExtensions/aaa/ext_emconf.php | 17 - TestExtensions/aaa/ext_icon.gif | Bin 630 -> 0 bytes TestExtensions/bbb/composer.json | 13 - TestExtensions/bbb/ext_emconf.php | 17 - TestExtensions/bbb/ext_icon.gif | Bin 630 -> 0 bytes TestExtensions/bbb/tests/.gitignore | 0 TestExtensions/ccc/composer.json | 13 - TestExtensions/ccc/ext_emconf.php | 17 - TestExtensions/ccc/ext_icon.gif | Bin 630 -> 0 bytes TestExtensions/ddd/composer.json | 13 - TestExtensions/ddd/ext_emconf.php | 17 - TestExtensions/ddd/ext_icon.gif | Bin 630 -> 0 bytes TestExtensions/user_phpunittest/composer.json | 12 - .../user_phpunittest/ext_emconf.php | 16 - TestExtensions/user_phpunittest/ext_icon.gif | Bin 1688 -> 0 bytes .../user_phpunittest2/composer.json | 13 - .../user_phpunittest2/ext_emconf.php | 16 - TestExtensions/user_phpunittest2/ext_icon.gif | Bin 630 -> 0 bytes Tests/Unit/BackEnd/AjaxTest.php | 202 ---- Tests/Unit/BackEnd/Fixtures/LoadMe.php | 10 - Tests/Unit/BackEnd/Fixtures/LoadMeToo.php | 10 - Tests/Unit/BackEnd/ModuleTest.php | 860 -------------- Tests/Unit/BackEnd/RequestTest.php | 388 ------- Tests/Unit/BackEnd/TestListenerTest.php | 985 ---------------- Tests/Unit/Exception/NoTestsDirectoryTest.php | 23 - Tests/Unit/Fixtures/LoadMe.php | 10 - .../Service/ExtensionSettingsServiceTest.php | 252 ----- Tests/Unit/Service/FakeOutputServiceTest.php | 116 -- .../Service/Fixtures/NonPhpFiles/test.txt | 1 - .../Service/Fixtures/NonTestFiles/Nothing.php | 1 - Tests/Unit/Service/Fixtures/OneTest.php | 6 - .../Fixtures/Subfolder/AnotherTest.php | 6 - Tests/Unit/Service/Fixtures/XTest.php | 6 - Tests/Unit/Service/OutputServiceTest.php | 51 - Tests/Unit/Service/TestCaseServiceTest.php | 413 ------- Tests/Unit/Service/TestFinderTest.php | 846 -------------- .../Unit/Service/UserSettingsServiceTest.php | 424 ------- Tests/Unit/TestCaseTest.php | 4 +- Tests/Unit/TestableTest.php | 275 ----- Tests/Unit/TestingDataContainerTest.php | 231 ---- .../ViewHelpers/AbstractTagViewHelperTest.php | 188 --- .../ViewHelpers/CheckboxViewHelperTest.php | 199 ---- .../ExtensionSelectorViewHelperTest.php | 386 ------- .../Fixtures/TestingTagViewHelper.php | 54 - .../ViewHelpers/ProgressBarViewHelperTest.php | 60 - composer.json | 14 +- ext_tables.php | 16 - 87 files changed, 6 insertions(+), 10692 deletions(-) delete mode 100644 Classes/AbstractDataContainer.php delete mode 100644 Classes/BackEnd/Ajax.php delete mode 100644 Classes/BackEnd/Module.php delete mode 100644 Classes/BackEnd/Request.php delete mode 100644 Classes/BackEnd/TestListener.php delete mode 100644 Classes/BackEnd/conf.php delete mode 100644 Classes/BackEnd/index.php delete mode 100644 Classes/Exception/NoTestsDirectory.php delete mode 100644 Classes/Interface/ConvertService.php delete mode 100644 Classes/Interface/ExtensionSettingsService.php delete mode 100644 Classes/Interface/Request.php delete mode 100644 Classes/Interface/UserSettingsService.php delete mode 100644 Classes/Service/ExtensionSettingsService.php delete mode 100644 Classes/Service/FakeOutputService.php delete mode 100644 Classes/Service/OutputService.php delete mode 100644 Classes/Service/TestCaseService.php delete mode 100644 Classes/Service/TestFinder.php delete mode 100644 Classes/Service/UserSettingsService.php delete mode 100644 Classes/Testable.php delete mode 100644 Classes/TestingDataContainer.php delete mode 100644 Classes/ViewHelpers/AbstractSelectorViewHelper.php delete mode 100644 Classes/ViewHelpers/AbstractTagViewHelper.php delete mode 100644 Classes/ViewHelpers/AbstractViewHelper.php delete mode 100644 Classes/ViewHelpers/CheckboxViewHelper.php delete mode 100644 Classes/ViewHelpers/ExtensionSelectorViewHelper.php delete mode 100644 Classes/ViewHelpers/ProgressBarViewHelper.php delete mode 100644 Resources/Private/Language/da.locallang_backend.xlf delete mode 100644 Resources/Private/Language/de.locallang_backend.xlf delete mode 100644 Resources/Private/Language/locallang_backend.xlf delete mode 100644 Resources/Public/CSS/BackEnd.css delete mode 100644 Resources/Public/Icons/BackEndModule.png delete mode 100644 Resources/Public/Icons/Runner.gif delete mode 100644 Resources/Public/Icons/RunnerRunning.gif delete mode 100644 Resources/Public/JavaScript/BackEnd.js delete mode 100644 TestExtensions/aaa/Tests/Unit/OneTest.php delete mode 100644 TestExtensions/aaa/Tests/Unit/fixtures/AnotherTest.php delete mode 100644 TestExtensions/aaa/composer.json delete mode 100644 TestExtensions/aaa/ext_emconf.php delete mode 100644 TestExtensions/aaa/ext_icon.gif delete mode 100644 TestExtensions/bbb/composer.json delete mode 100644 TestExtensions/bbb/ext_emconf.php delete mode 100644 TestExtensions/bbb/ext_icon.gif delete mode 100644 TestExtensions/bbb/tests/.gitignore delete mode 100644 TestExtensions/ccc/composer.json delete mode 100644 TestExtensions/ccc/ext_emconf.php delete mode 100644 TestExtensions/ccc/ext_icon.gif delete mode 100644 TestExtensions/ddd/composer.json delete mode 100644 TestExtensions/ddd/ext_emconf.php delete mode 100644 TestExtensions/ddd/ext_icon.gif delete mode 100644 TestExtensions/user_phpunittest/composer.json delete mode 100644 TestExtensions/user_phpunittest/ext_emconf.php delete mode 100644 TestExtensions/user_phpunittest/ext_icon.gif delete mode 100644 TestExtensions/user_phpunittest2/composer.json delete mode 100644 TestExtensions/user_phpunittest2/ext_emconf.php delete mode 100644 TestExtensions/user_phpunittest2/ext_icon.gif delete mode 100644 Tests/Unit/BackEnd/AjaxTest.php delete mode 100644 Tests/Unit/BackEnd/Fixtures/LoadMe.php delete mode 100644 Tests/Unit/BackEnd/Fixtures/LoadMeToo.php delete mode 100644 Tests/Unit/BackEnd/ModuleTest.php delete mode 100644 Tests/Unit/BackEnd/RequestTest.php delete mode 100644 Tests/Unit/BackEnd/TestListenerTest.php delete mode 100644 Tests/Unit/Exception/NoTestsDirectoryTest.php delete mode 100644 Tests/Unit/Fixtures/LoadMe.php delete mode 100644 Tests/Unit/Service/ExtensionSettingsServiceTest.php delete mode 100644 Tests/Unit/Service/FakeOutputServiceTest.php delete mode 100644 Tests/Unit/Service/Fixtures/NonPhpFiles/test.txt delete mode 100644 Tests/Unit/Service/Fixtures/NonTestFiles/Nothing.php delete mode 100644 Tests/Unit/Service/Fixtures/OneTest.php delete mode 100644 Tests/Unit/Service/Fixtures/Subfolder/AnotherTest.php delete mode 100644 Tests/Unit/Service/Fixtures/XTest.php delete mode 100644 Tests/Unit/Service/OutputServiceTest.php delete mode 100644 Tests/Unit/Service/TestCaseServiceTest.php delete mode 100644 Tests/Unit/Service/TestFinderTest.php delete mode 100644 Tests/Unit/Service/UserSettingsServiceTest.php delete mode 100644 Tests/Unit/TestableTest.php delete mode 100644 Tests/Unit/TestingDataContainerTest.php delete mode 100644 Tests/Unit/ViewHelpers/AbstractTagViewHelperTest.php delete mode 100644 Tests/Unit/ViewHelpers/CheckboxViewHelperTest.php delete mode 100644 Tests/Unit/ViewHelpers/ExtensionSelectorViewHelperTest.php delete mode 100644 Tests/Unit/ViewHelpers/Fixtures/TestingTagViewHelper.php delete mode 100644 Tests/Unit/ViewHelpers/ProgressBarViewHelperTest.php delete mode 100644 ext_tables.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 4741a3fc..50d13f0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Deprecated ### Removed +- Drop the back-end module (#118) - Remove the UI for code coverage (#116) - Drop the IDE test runner (#114, #117) - Drop the testing framework (#113, #115) diff --git a/Classes/AbstractDataContainer.php b/Classes/AbstractDataContainer.php deleted file mode 100644 index 8cfccb5a..00000000 --- a/Classes/AbstractDataContainer.php +++ /dev/null @@ -1,113 +0,0 @@ - - */ -abstract class Tx_Phpunit_AbstractDataContainer -{ - /** - * Returns the boolean value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return bool the value for the given key, will be FALSE if there is no value for the given key - */ - public function getAsBoolean($key) - { - return (bool)$this->get($key); - } - - /** - * Returns the integer value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return int the value for the given key, will be 0 if there is no value for the given key - */ - public function getAsInteger($key) - { - return (int)$this->get($key); - } - - /** - * Checks whether there is a non-zero integer for $key. - * - * @param string $key the key of the value to check, must not be empty - * - * @return bool whether there is a non-zero integer for $key - */ - public function hasInteger($key) - { - return $this->getAsInteger($key) !== 0; - } - - /** - * Returns the string value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return string the value for the given key, will be "" if there is no value for the given key - */ - public function getAsString($key) - { - return (string)$this->get($key); - } - - /** - * Checks whether there is a non-empty string for $key. - * - * @param string $key the key of the value to check, must not be empty - * - * @return bool whether there is a non-empty string for $key - */ - public function hasString($key) - { - return $this->getAsString($key) !== ''; - } - - /** - * Returns the array value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return array the value for the given key, will be empty if there is no array value for the given key - */ - public function getAsArray($key) - { - $rawValue = $this->get($key); - if (!is_array($rawValue)) { - $rawValue = []; - } - - return $rawValue; - } - - /** - * Returns the value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return mixed the value for the given key, will be NULL if there is no value for the given key - */ - abstract protected function get($key); - - /** - * Checks that $key is non-empty. - * - * @param string $key the key to check, may be empty - * - * @throws \InvalidArgumentException if $key is empty - * - * @return void - */ - protected function checkForNonEmptyKey($key) - { - if ($key === '') { - throw new \InvalidArgumentException('$key must not be empty.', 1335021694); - } - } -} diff --git a/Classes/BackEnd/Ajax.php b/Classes/BackEnd/Ajax.php deleted file mode 100644 index b3552207..00000000 --- a/Classes/BackEnd/Ajax.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @author Michael Klapper - * @author Oliver Klee - * @author Bastian Waidelich - * @author Carsten Koenig - */ -class Tx_Phpunit_BackEnd_Ajax -{ - /** - * @var \Tx_Phpunit_Interface_UserSettingsService - */ - protected $userSettingsService = null; - - /** - * @var string[] - */ - protected static $validCheckboxKeys = [ - 'failure', - 'success', - 'error', - 'skipped', - 'incomplete', - 'testdox', - ]; - - /** - * The constructor. - * - * @param bool $initializeUserSettingsService whether to automatically initialize the user settings service - */ - public function __construct($initializeUserSettingsService = true) - { - if ($initializeUserSettingsService) { - /** @var \Tx_Phpunit_Service_UserSettingsService $userSettingsService */ - $userSettingsService = GeneralUtility::makeInstance(\Tx_Phpunit_Service_UserSettingsService::class); - $this->injectUserSettingsService($userSettingsService); - } - } - - /** - * Injects the user settings service. - * - * @param \Tx_Phpunit_Interface_UserSettingsService $service the service to inject - * - * @return void - */ - public function injectUserSettingsService(\Tx_Phpunit_Interface_UserSettingsService $service) - { - $this->userSettingsService = $service; - } - - /** - * Used to broker incoming requests to other calls. - * Called by typo3/ajax.php - * - * @param array $unused additional parameters (not used) - * @param AjaxRequestHandler $ajax the AJAX object for this request - * - * @return void - */ - public function ajaxBroker(array $unused, AjaxRequestHandler $ajax) - { - $state = (bool)GeneralUtility::_POST('state'); - $checkbox = GeneralUtility::_POST('checkbox'); - - if (in_array($checkbox, self::$validCheckboxKeys, true)) { - $ajax->setContentFormat('json'); - $this->userSettingsService->set($checkbox, $state); - $ajax->addContent('success', true); - } else { - $ajax->setContentFormat('plain'); - $ajax->setError('Illegal input parameters.'); - } - } -} diff --git a/Classes/BackEnd/Module.php b/Classes/BackEnd/Module.php deleted file mode 100644 index 3e7fcfb7..00000000 --- a/Classes/BackEnd/Module.php +++ /dev/null @@ -1,1008 +0,0 @@ - - * @author Michael Klapper - * @author Oliver Klee - * @author Bastian Waidelich - * @author Carsten Koenig - */ -class Tx_Phpunit_BackEnd_Module extends BaseScriptClass -{ - /** - * @var string - */ - const MODULE_NAME = 'tools_txphpunitbeM1'; - - /** - * the relative path to this extension - * - * @var string - */ - protected $extensionPath = ''; - - /** - * a name prettifier for creating readable test and test case names - * - * @var \PHPUnit_Util_TestDox_NamePrettifier - */ - protected $namePrettifier = null; - - /** - * @var \Tx_Phpunit_Interface_Request - */ - protected $request = null; - - /** - * @var \Tx_Phpunit_Service_TestFinder - */ - protected $testFinder = null; - - /** - * @var \Tx_Phpunit_Service_TestCaseService - */ - protected $testCaseService = null; - - /** - * @var \Tx_Phpunit_BackEnd_TestListener - */ - protected $testListener = null; - - /** - * @var \Tx_Phpunit_Service_OutputService - */ - protected $outputService = null; - - /** - * @var \Tx_Phpunit_Interface_UserSettingsService - */ - protected $userSettingsService = null; - - /** - * The constructor. - */ - public function __construct() - { - $this->init(); - - $this->extensionPath = PathUtility::getAbsoluteWebPath('../typo3conf/ext/phpunit/'); - } - - /** - * Injects the request. - * - * @param \Tx_Phpunit_Interface_Request $request the request to inject - * - * @return void - */ - public function injectRequest(\Tx_Phpunit_Interface_Request $request) - { - $this->request = $request; - } - - /** - * Injects the test listener. - * - * @param \Tx_Phpunit_BackEnd_TestListener $testListener the test listener to inject - * - * @return void - */ - public function injectTestListener(\Tx_Phpunit_BackEnd_TestListener $testListener) - { - $this->testListener = $testListener; - } - - /** - * Injects the name prettifier. - * - * @param \PHPUnit_Util_TestDox_NamePrettifier $namePrettifier the name prettifier to inject - * - * @return void - */ - public function injectNamePrettifier(\PHPUnit_Util_TestDox_NamePrettifier $namePrettifier) - { - $this->namePrettifier = $namePrettifier; - } - - /** - * Injects the output service. - * - * @param \Tx_Phpunit_Service_OutputService $service the service to inject - * - * @return void - */ - public function injectOutputService(\Tx_Phpunit_Service_OutputService $service) - { - $this->outputService = $service; - } - - /** - * Injects the user settings service. - * - * @param \Tx_Phpunit_Interface_UserSettingsService $service the service to inject - * - * @return void - */ - public function injectUserSettingsService(\Tx_Phpunit_Interface_UserSettingsService $service) - { - $this->userSettingsService = $service; - } - - /** - * Injects the test finder. - * - * @param \Tx_Phpunit_Service_TestFinder $testFinder the test finder to inject - * - * @return void - */ - public function injectTestFinder(\Tx_Phpunit_Service_TestFinder $testFinder) - { - $this->testFinder = $testFinder; - } - - /** - * Injects the test case service. - * - * @param \Tx_Phpunit_Service_TestCaseService $testCaseService the test case service to inject - * - * @return void - */ - public function injectTestCaseService(\Tx_Phpunit_Service_TestCaseService $testCaseService) - { - $this->testCaseService = $testCaseService; - } - - /** - * Returns the localized string for the key $key. - * - * @param string $key the key of the string to retrieve, must not be empty - * - * @return string the localized string for the key $key - */ - protected function translate($key) - { - return $this->getLanguageService()->getLL($key); - } - - /** - * Main function of the module. Outputs all content directly instead of collecting it and doing the output later. - * - * @return void - */ - public function main() - { - $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class); - $this->doc->backPath = $GLOBALS['BACK_PATH']; - - if ($GLOBALS['BE_USER']->user['admin']) { - $this->doc->bodyTagAdditions = 'id="doc3"'; - - $this->addAdditionalHeaderData(); - - $this->cleanOutputBuffers(); - $this->outputService->output( - $this->doc->startPage($this->translate('title')) . - $this->doc->header(\PHPUnit_Runner_Version::getVersionString()) - ); - - $this->renderRunTests(); - - $this->outputService->output( - $this->doc->section( - $this->translate('shortcuts.title'), - '

' . $this->translate('shortcuts.text') . '

-

' . $this->translate('shortcuts.browser_dependency') . '

-
    -
  • ' . $this->translate('shortcuts.browser_safari_ie') . '
  • -
  • ' . $this->translate('shortcuts.browser_firefox') . '
  • -
' - ) - ); - } else { - $this->outputService->output( - $this->doc->startPage($this->translate('title')) . - $this->doc->header($this->translate('title')) . - $this->translate('admin_rights_needed') - ); - } - - $this->outputService->output($this->doc->endPage()); - } - - /** - * Adds some JavaScript and CSS stuff to header data. - * - * @return void - */ - protected function addAdditionalHeaderData() - { - /** @var PageRenderer $pageRenderer */ - $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); - $pageRenderer->loadJquery(); - $publicResourcesPath = $this->extensionPath . 'Resources/Public/'; - $pageRenderer->addJsFile($publicResourcesPath . 'JavaScript/BackEnd.js', 'text/javascript', false); - $pageRenderer->addCssFile($publicResourcesPath . 'CSS/BackEnd.css', 'stylesheet', 'all', '', false); - } - - /** - * Ends and cleans all output buffers. - * - * @return void - */ - protected function cleanOutputBuffers() - { - do { - $hasMoreBuffers = ob_end_clean(); - } while ($hasMoreBuffers); - } - - /********************************************************* - * - * Screen render functions - * - *********************************************************/ - - /** - * Renders the screens for function "Run tests". - * - * @return void - */ - protected function renderRunTests() - { - $command = $this->request->getAsString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_COMMAND); - switch ($command) { - case 'runalltests': - // The fallthrough is intentional. - case 'runTestCaseFile': - // The fallthrough is intentional. - case 'runsingletest': - $this->renderRunTestsIntro(); - $this->renderRunningTest(); - break; - default: - $this->renderRunTestsIntro(); - } - } - - /** - * Gets the key of the currently selected testable and saves it to the user settings. - * - * @return string the currently selected testable key, will not be empty - */ - protected function getAndSaveSelectedTestableKey() - { - $testableKeyFromSettings = - $this->userSettingsService->getAsString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE); - - if ($this->request->hasString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE)) { - $selectedTestableKey = $this->request->getAsString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE); - } else { - $selectedTestableKey = $testableKeyFromSettings; - } - - if (($selectedTestableKey !== \Tx_Phpunit_Testable::ALL_EXTENSIONS) - && !$this->testFinder->existsTestableForKey($selectedTestableKey) - ) { - // We know that phpunit must be loaded. - $selectedTestableKey = 'phpunit'; - } - - if ($selectedTestableKey !== $testableKeyFromSettings) { - $this->userSettingsService->set( - \Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE, - $selectedTestableKey - ); - } - - return $selectedTestableKey; - } - - /** - * Renders the intro screen for the function "Run tests". - * - * @return void - */ - protected function renderRunTestsIntro() - { - /** @var FlashMessageService $flashMessageService */ - $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); - $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier(); - if (!$this->testFinder->existsTestableForAnything()) { - /** @var FlashMessage $message */ - $message = GeneralUtility::makeInstance( - FlashMessage::class, - $this->translate('could_not_find_exts_with_tests'), - '', - FlashMessage::WARNING - ); - $defaultFlashMessageQueue->enqueue($message); - $this->outputService->output($defaultFlashMessageQueue->renderFlashMessages()); - return; - } - - /** @var FlashMessage $message */ - $message = GeneralUtility::makeInstance( - FlashMessage::class, - $this->translate('test_are_run_in_current_backend_context.message'), - $this->translate('test_are_run_in_current_backend_context.title'), - FlashMessage::WARNING - ); - $defaultFlashMessageQueue->enqueue($message); - $this->outputService->output($defaultFlashMessageQueue->renderFlashMessages()); - - $this->outputService->output('


'); - - $this->createExtensionSelector(); - $selectedExtensionKey = $this->getAndSaveSelectedTestableKey(); - - $output = ''; - if ($selectedExtensionKey !== \Tx_Phpunit_Testable::ALL_EXTENSIONS) { - $output .= $this->createTestCaseSelector($selectedExtensionKey) - . $this->createTestSelector($selectedExtensionKey); - } - $output .= $this->createCheckboxes(); - - $this->outputService->output($output); - } - - /** - * Creates the extension drop-down. - * - * @return void - */ - protected function createExtensionSelector() - { - $this->getAndSaveSelectedTestableKey(); - - /** @var \Tx_Phpunit_ViewHelpers_ExtensionSelectorViewHelper $extensionSelectorViewHelper */ - $extensionSelectorViewHelper = - GeneralUtility::makeInstance(\Tx_Phpunit_ViewHelpers_ExtensionSelectorViewHelper::class); - $extensionSelectorViewHelper->injectOutputService($this->outputService); - $extensionSelectorViewHelper->injectUserSettingService($this->userSettingsService); - $extensionSelectorViewHelper->injectTestFinder($this->testFinder); - $extensionSelectorViewHelper->setAction(BackendUtility::getModuleUrl('tools_txphpunitbeM1')); - - $extensionSelectorViewHelper->render(); - } - - /** - * Renders a drop-down for running single tests cases for the given extension. - * - * @param string $extensionKey - * keys of the extension for which to render the drop-down - * - * @return string - * HTML code with the drop-down and a surrounding form, will be empty - * if no loaded single extension is selected - */ - protected function createTestCaseSelector($extensionKey) - { - if (!$this->testFinder->existsTestableForKey($extensionKey)) { - return ''; - } - - $testsPathOfExtension = $this->testFinder->getTestableForKey($extensionKey)->getTestsPath(); - $testSuites = $this->testCaseService->findTestCaseFilesInDirectory($testsPathOfExtension); - - foreach ($testSuites as $fileName) { - require_once $testsPathOfExtension . $fileName; - } - - $testSuite = new \PHPUnit_Framework_TestSuite('tx_phpunit_basetestsuite'); - foreach (get_declared_classes() as $className) { - if ($this->testCaseService->isValidTestCaseClassName($className)) { - $testSuite->addTestSuite($className); - } - } - - // testCaseFile - $testCaseFileOptionsArray = []; - /** @var \PHPUnit_Framework_TestCase $testCase */ - foreach ($testSuite->tests() as $testCase) { - $selected = - ($testCase->toString() - === $this->request->getAsString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTCASE)) - ? ' selected="selected"' : ''; - $testCaseFileOptionsArray[] = ''; - } - - $currentStyle = $this->createIconStyle($extensionKey); - - return '
' . - '

' . - '' . - '' . - '' . - '

' . - '
'; - } - - /** - * Renders a drop-down for running single tests for the given extension. - * - * @param string $extensionKey - * keys of the extension for which to render the drop-down - * - * @return string - * HTML code with the drop-down and a surrounding form - */ - protected function createTestSelector($extensionKey) - { - if (!$this->testFinder->existsTestableForKey($extensionKey)) { - return ''; - } - - $testSuite = new \PHPUnit_Framework_TestSuite('tx_phpunit_basetestsuite'); - - $testsPathOfExtension = $this->testFinder->getTestableForKey($extensionKey)->getTestsPath(); - $testSuites = $this->testCaseService->findTestCaseFilesInDirectory($testsPathOfExtension); - - foreach ($testSuites as $fileName) { - require_once $testsPathOfExtension . $fileName; - } - - foreach (get_declared_classes() as $className) { - if ($this->testCaseService->isValidTestCaseClassName($className)) { - $testSuite->addTestSuite($className); - } - } - - // single test case - /** @var string[][] $testsOptionsArr */ - $testsOptionsArr = []; - $testCaseFile = $this->request->getAsString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTCASE); - $useHumanReadableOptionLabels = $this->userSettingsService->getAsBoolean('testdox'); - - /** @var \PHPUnit_Framework_TestSuite $testCase */ - foreach ($testSuite->tests() as $testCase) { - if (($testCaseFile !== null) && ($testCase->getName() !== $testCaseFile)) { - continue; - } - /** @var \PHPUnit_Framework_TestCase $test */ - foreach ($testCase->tests() as $test) { - if ($test instanceof \PHPUnit_Framework_TestSuite) { - list($testSuiteName, $testName) = explode('::', $test->getName()); - $testIdentifier = $testName . '(' . $testSuiteName . ')'; - } else { - $testName = $test->getName(); - $testIdentifier = $test->toString(); - $testSuiteName = strstr($testIdentifier, '('); - $testSuiteName = trim($testSuiteName, '()'); - } - $selected = - ($testIdentifier === $this->request->getAsString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TEST)) - ? ' selected="selected"' : ''; - $testCaption = - $useHumanReadableOptionLabels ? $this->namePrettifier->prettifyTestMethod($testName) : $testName; - $testsOptionsArr[$testSuiteName][] .= ''; - } - } - - if (count($testsOptionsArr) === 0) { - return ''; - } - - // builds options for select (including option groups for test suites) - $testOptionsHtml = ''; - foreach ($testsOptionsArr as $suiteName => $testArr) { - $testOptionsHtml .= ''; - foreach ($testArr as $testHtml) { - $testOptionsHtml .= $testHtml; - } - $testOptionsHtml .= ''; - } - - $currentStyle = $this->createIconStyle($extensionKey); - - return '
-

- - - - -

-
'; - } - - /** - * Renders the checkboxes for hiding or showing various test results. - * - * @return string - * HTML code with checkboxes and a surrounding form - */ - protected function createCheckboxes() - { - $output = - '
'; - $output .= '
'; - $failureState = $this->userSettingsService->getAsBoolean('failure') ? 'checked="checked"' : ''; - $errorState = $this->userSettingsService->getAsBoolean('error') ? 'checked="checked"' : ''; - $skippedState = $this->userSettingsService->getAsBoolean('skipped') ? 'checked="checked"' : ''; - $successState = $this->userSettingsService->getAsBoolean('success') ? 'checked="checked"' : ''; - $incompleteState = $this->userSettingsService->getAsBoolean('incomplete') ? 'checked="checked"' : ''; - $testdoxState = $this->userSettingsService->getAsBoolean('testdox') ? 'checked="checked"' : ''; - $output .= ''; - $output .= ' '; - $output .= ' '; - $output .= ' '; - $output .= ' '; - $output .= ' '; - - $output .= '
'; - $output .= '
'; - - return $output; - } - - /** - * Renders the screen for the function "Run tests" which shows and runs the actual unit tests. - * - * @return void - */ - protected function renderRunningTest() - { - $this->setPhpUnitErrorHandler(); - - $selectedTestableKey = $this->getAndSaveSelectedTestableKey(); - $this->renderTestingHeader($selectedTestableKey); - - $this->renderReRunButton(); - - $testablesToProcess = $this->collectTestablesToProcess($selectedTestableKey); - - $this->loadAllFilesContainingTestCasesForTestables($testablesToProcess); - - $testSuite = $this->createTestSuiteWithAllTestCases(); - - $testResult = new \PHPUnit_Framework_TestResult(); - - $this->configureTestListener(); - $testResult->addListener($this->testListener); - - if ($this->request->hasString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TEST)) { - $this->runSingleTest($testSuite, $testResult); - } elseif ($this->request->hasString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTCASE)) { - $this->runTestCase($testSuite, $testResult); - } else { - $this->runAllTests($testSuite, $testResult); - } - - $this->renderTestStatistics($testResult); - - $this->renderTestsFinishedMarker(); - $this->renderReRunButton(); - } - - /** - * Sets the \PHPUnit error handler to catch all errors. - * This is important as PHPUnit only sets its error handler if nothing has been set before, - * but typically an error handler is set during by TYPO3 during the initialization. - * - * @return void - */ - protected function setPhpUnitErrorHandler() - { - set_error_handler(['PHPUnit_Util_ErrorHandler', 'handleError'], E_ALL | E_STRICT); - } - - /** - * Renders and outputs the "Testing ..." header for the given testable key. - * - * @param string $testableKey the key of the selected testable - * - * @return void - */ - protected function renderTestingHeader($testableKey) - { - if ($testableKey === \Tx_Phpunit_Testable::ALL_EXTENSIONS) { - $this->outputService->output('

' . $this->translate('testing_all_extensions') . '

'); - } else { - $this->outputService->output( - '

' . $this->translate('testing_extension') . ': ' . htmlspecialchars($testableKey, ENT_HTML5 | ENT_QUOTES) . '

' - ); - } - } - - /** - * Collects the testables to process as directed by the given testable key. - * - * @param string $testableKey the key of the selected testable - * - * @return \Tx_Phpunit_Testable[] the testables to process - */ - protected function collectTestablesToProcess($testableKey) - { - if ($testableKey === \Tx_Phpunit_Testable::ALL_EXTENSIONS) { - $testablesToProcess = $this->testFinder->getTestablesForEverything(); - } else { - $testablesToProcess = [$this->testFinder->getTestableForKey($testableKey)]; - } - - return $testablesToProcess; - } - - /** - * Loads all files containing test cases for the given testables. - * - * @param \Tx_Phpunit_Testable[] $testables the testables for which to load all test case files - * - * @return void - */ - protected function loadAllFilesContainingTestCasesForTestables(array $testables) - { - /** @var \Tx_Phpunit_Testable $testable */ - foreach ($testables as $testable) { - $this->loadAllFilesContainingTestCasesForSingleTestable($testable); - } - } - - /** - * Loads all files containing test cases for the given testable. - * - * @param \Tx_Phpunit_Testable $testable the testable for which to load all test case files - * - * @return void - */ - protected function loadAllFilesContainingTestCasesForSingleTestable(\Tx_Phpunit_Testable $testable) - { - $testsPath = $testable->getTestsPath(); - $testCaseFileNames = $this->testCaseService->findTestCaseFilesInDirectory($testsPath); - foreach ($testCaseFileNames as $testCaseFileName) { - require_once realpath($testsPath . $testCaseFileName); - } - } - - /** - * Creates a test suite that contains all test cases in the systems (but filters out this extension's base test - * cases). - * - * @return \PHPUnit_Framework_TestSuite the test suite with all test cases added - */ - protected function createTestSuiteWithAllTestCases() - { - $testSuite = new \PHPUnit_Framework_TestSuite('tx_phpunit_basetestsuite'); - - foreach (get_declared_classes() as $className) { - if ($this->testCaseService->isValidTestCaseClassName($className)) { - $testSuite->addTestSuite($className); - } - } - - return $testSuite; - } - - /** - * Configures the test listener as defined in the user settings. - * - * @return void - */ - protected function configureTestListener() - { - if ($this->userSettingsService->getAsBoolean('testdox')) { - $this->testListener->useHumanReadableTextFormat(); - } - } - - /** - * Runs a single test as given in the GET/POST variable. - * - * @param \PHPUnit_Framework_TestSuite $testSuiteWithAllTestCases suite with all test cases - * @param \PHPUnit_Framework_TestResult $testResult the test result (will be modified) - * - * @return void - */ - protected function runSingleTest( - \PHPUnit_Framework_TestSuite $testSuiteWithAllTestCases, - \PHPUnit_Framework_TestResult $testResult - ) { - $this->renderProgressbar(); - /** @var \PHPUnit_Framework_TestSuite $testCases */ - foreach ($testSuiteWithAllTestCases->tests() as $testCases) { - foreach ($testCases->tests() as $test) { - if ($test instanceof \PHPUnit_Framework_TestSuite) { - /** @var \PHPUnit_Framework_TestSuite $test */ - list($testSuiteName, $testName) = explode('::', $test->getName()); - $this->testListener->setTestSuiteName($testSuiteName); - $testIdentifier = $testName . '(' . $testSuiteName . ')'; - } else { - /** @var \PHPUnit_Framework_SelfDescribing $test */ - $testIdentifier = $test->toString(); - $testIdentifierParts = explode('::', $testIdentifier); - $testSuiteName = $testIdentifierParts[0]; - $this->testListener->setTestSuiteName($testSuiteName); - } - if ($testIdentifier - === $this->request->getAsString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TEST)) { - if ($test instanceof \PHPUnit_Framework_TestSuite) { - $this->testListener->setTotalNumberOfTests($test->count()); - } else { - $this->testListener->setTotalNumberOfTests(1); - } - $this->outputService->output('

Testsuite: ' . $testCases->getName() - . '

'); - $test->run($testResult); - } - } - } - } - - /** - * Runs a testcase as given in the GET/POST variable "testCaseFile". - * - * @param \PHPUnit_Framework_TestSuite $testSuiteWithAllTestCases suite with all test cases - * @param \PHPUnit_Framework_TestResult $testResult the test result (will be modified) - * - * @return void - */ - protected function runTestCase( - \PHPUnit_Framework_TestSuite $testSuiteWithAllTestCases, - \PHPUnit_Framework_TestResult $testResult - ) { - $testCaseFileName = $this->request->getAsString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTCASE); - $this->testListener->setTestSuiteName($testCaseFileName); - - $suiteNameHasBeenDisplayed = false; - $totalNumberOfTestCases = 0; - foreach ($testSuiteWithAllTestCases->tests() as $testSuite) { - /** @var \PHPUnit_Framework_TestSuite $testSuite */ - foreach ($testSuite->tests() as $test) { - if ($test instanceof \PHPUnit_Framework_TestSuite) { - $testIdentifierParts = explode('::', $test->getName()); - $testIdentifier = $testIdentifierParts[0]; - } else { - $testIdentifier = get_class($test); - } - if ($testIdentifier === $testCaseFileName) { - if ($test instanceof \PHPUnit_Framework_TestSuite) { - $totalNumberOfTestCases += $test->count(); - } else { - $totalNumberOfTestCases++; - } - } - } - } - $this->testListener->setTotalNumberOfTests($totalNumberOfTestCases); - $this->renderProgressbar(); - - foreach ($testSuiteWithAllTestCases->tests() as $testSuite) { - /** @var \PHPUnit_Framework_TestSuite $testSuite */ - foreach ($testSuite->tests() as $test) { - if ($test instanceof \PHPUnit_Framework_TestSuite) { - $testIdentifierParts = explode('::', $test->getName()); - $testIdentifier = $testIdentifierParts[0]; - } else { - $testIdentifier = get_class($test); - } - if ($testIdentifier === $testCaseFileName) { - if (!$suiteNameHasBeenDisplayed) { - $this->outputService->output('

Testsuite: ' . $testCaseFileName - . '

'); - $suiteNameHasBeenDisplayed = true; - } - $test->run($testResult); - } - } - } - } - - /** - * Runs all tests. - * - * @param \PHPUnit_Framework_TestSuite $testSuiteWithAllTestCases suite with all test cases - * @param \PHPUnit_Framework_TestResult $testResult the test result (will be modified) - * - * @return void - */ - protected function runAllTests( - \PHPUnit_Framework_TestSuite $testSuiteWithAllTestCases, - \PHPUnit_Framework_TestResult $testResult - ) { - $this->testListener->setTotalNumberOfTests($testSuiteWithAllTestCases->count()); - $this->renderProgressbar(); - $testSuiteWithAllTestCases->run($testResult); - } - - /** - * Renders and output the tests statistics. - * - * @param \PHPUnit_Framework_TestResult $testResult the test result - * - * @return void - */ - protected function renderTestStatistics(\PHPUnit_Framework_TestResult $testResult) - { - if ($testResult->wasSuccessful()) { - $testStatistics = '

' . $this->translate('testing_success') . '

'; - } elseif ($testResult->errorCount() > 0) { - $testStatistics = ' -

' . $this->translate('testing_failure') . '

'; - } else { - $testStatistics = ' -

' . $this->translate('testing_failure') . '

'; - } - $testStatistics .= '

' . $testResult->count() . ' ' . $this->translate('tests_total') . ', ' - . $this->testListener->assertionCount() . ' ' . - $this->translate('assertions_total') . ', ' . $testResult->failureCount() . ' ' - . $this->translate('tests_failures') . - ', ' . $testResult->skippedCount() . ' ' . $this->translate('tests_skipped') . ', ' . - $testResult->notImplementedCount() . ' ' . $this->translate('tests_incomplete') . ', ' - . $testResult->errorCount() . - ' ' . $this->translate('tests_errors') . '

'; - $this->outputService->output($testStatistics); - } - - /** - * Renders and output the re-run button. - * - * @return void - */ - protected function renderReRunButton() - { - $this->outputService->output( - '
-

- - - - -

-
' - ); - } - - /** - * Renders and output the marker that communicates that the tests have finished. - * - * @return void - */ - protected function renderTestsFinishedMarker() - { - $this->outputService->output('
'); - } - - /** - * Renders DIVs which contain information and a progressbar to visualize - * the running tests. - * - * The actual information will be written via JS during - * the test runs. - * - * @return void - */ - protected function renderProgressbar() - { - /** @var \Tx_Phpunit_ViewHelpers_ProgressBarViewHelper $progressBarViewHelper */ - $progressBarViewHelper = GeneralUtility::makeInstance(\Tx_Phpunit_ViewHelpers_ProgressBarViewHelper::class); - $progressBarViewHelper->injectOutputService($this->outputService); - $progressBarViewHelper->render(); - } - - /********************************************************* - * - * Helper functions - * - *********************************************************/ - - /** - * Recursively finds all test case files in the directory $directory. - * - * @param string $directory - * the absolute path of the directory in which to look for test cases, - * must not be empty - * - * @return array[] - * files names of the test cases in the directory $dir and all - * its subdirectories relative to $dir, will be empty if no - * test cases have been found - */ - protected function findTestCasesInDir($directory) - { - if (!is_dir($directory)) { - return []; - } - - $testCaseFileNames = $this->testCaseService->findTestCaseFilesInDirectory($directory); - - $extensionsArr = []; - if (!empty($testCaseFileNames)) { - $extensionsArr[$directory] = $testCaseFileNames; - } - - return $extensionsArr; - } - - /** - * Includes all PHP files given in $paths. - * - * @param array[] $paths - * array keys: absolute path - * array values: array of file names in that path - * - * @return void - */ - protected function loadRequiredTestClasses(array $paths) - { - foreach ($paths as $path => $fileNames) { - foreach ($fileNames as $fileName) { - require_once realpath($path . '/' . $fileName); - } - } - } - - /** - * Creates the CSS style attribute content for an icon for the extension - * $extensionKey. - * - * @param string $extensionKey - * the key of a loaded extension, may also be "typo3" - * - * @return string the content for the "style" attribute, will not be empty - * - * @throws \Tx_Phpunit_Exception_NoTestsDirectory - * if there is not extension with tests with the given key - */ - protected function createIconStyle($extensionKey) - { - if ($extensionKey === '') { - throw new \Tx_Phpunit_Exception_NoTestsDirectory('$extensionKey must not be empty.', 1303503647); - } - if (!$this->testFinder->existsTestableForKey($extensionKey)) { - throw new \Tx_Phpunit_Exception_NoTestsDirectory( - 'The extension ' . $extensionKey . ' is not loaded.', - 1303503664 - ); - } - - $testable = $this->testFinder->getTestableForKey($extensionKey); - - return 'background: url(' . $testable->getIconPath() . ') 3px 50% white no-repeat; padding: 1px 1px 1px 24px;'; - } -} diff --git a/Classes/BackEnd/Request.php b/Classes/BackEnd/Request.php deleted file mode 100644 index 358b9592..00000000 --- a/Classes/BackEnd/Request.php +++ /dev/null @@ -1,56 +0,0 @@ - - */ -class Tx_Phpunit_BackEnd_Request extends \Tx_Phpunit_AbstractDataContainer implements \Tx_Phpunit_Interface_Request, SingletonInterface -{ - /** - * @var array - */ - private $cachedRequestData = []; - - /** - * @var bool - */ - private $requestDataHasBeenRetrieved = false; - - /** - * Returns the value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return mixed the value for the given key, will be NULL if there is no value for the given key - */ - protected function get($key) - { - $this->checkForNonEmptyKey($key); - if (!$this->requestDataHasBeenRetrieved) { - $this->retrieveRequestData(); - } - if (!isset($this->cachedRequestData[$key])) { - return null; - } - - return $this->cachedRequestData[$key]; - } - - /** - * Retrieves the EM configuration for the PHPUnit extension. - * - * @return void - */ - protected function retrieveRequestData() - { - $this->cachedRequestData = GeneralUtility::_GP(\Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE); - - $this->requestDataHasBeenRetrieved = true; - } -} diff --git a/Classes/BackEnd/TestListener.php b/Classes/BackEnd/TestListener.php deleted file mode 100644 index 801720de..00000000 --- a/Classes/BackEnd/TestListener.php +++ /dev/null @@ -1,629 +0,0 @@ - - * @author Kasper Ligaard - * @author Michael Klapper - * @author Oliver Klee - */ -class Tx_Phpunit_BackEnd_TestListener implements \PHPUnit_Framework_TestListener -{ - /** - * @var \Tx_Phpunit_Service_OutputService - */ - protected $outputService = null; - - /** - * the total number of tests to run - * - * @var int - */ - protected $totalNumberOfTests = 0; - - /** - * the total number of data provider tests detected - * - * @var int - */ - protected $totalNumberOfDetectedDataProviderTests = 0; - - /** - * the number of the current test (zero-based) - * - * @var int - */ - protected $currentTestNumber = 0; - - /** - * the number of the current data provider within a test (zero-based) - * - * @var int - */ - protected $currentDataProviderNumber = 0; - - /** - * the name of the current test case - * - * @var string - */ - protected $currentTestCaseName = ''; - - /** - * the name of the current test - * - * @var string - */ - protected $previousTestName = ''; - - /** - * used memory (in bytes) before the first test is run - * - * @var int - */ - protected $memoryUsageStartOfTest = 0; - - /** - * used memory (in bytes) after the last test has been run - * - * @var int - */ - protected $memoryUsageEndOfTest = 0; - - /** - * the number of executed assertions - * - * @var int - */ - protected $testAssertions = 0; - - /** - * whether to use the "testdox" format to display test case and test names - * - * @var bool - */ - protected $useHumanReadableTextFormat = false; - - /** - * a name prettifier for creating readable test and test case names - * - * @var \PHPUnit_Util_TestDox_NamePrettifier - */ - protected $namePrettifier = null; - - /** - * Injects the name prettifier. - * - * @param \PHPUnit_Util_TestDox_NamePrettifier $namePrettifier the name prettifier to inject - * - * @return void - */ - public function injectNamePrettifier(\PHPUnit_Util_TestDox_NamePrettifier $namePrettifier) - { - $this->namePrettifier = $namePrettifier; - } - - /** - * Injects the output service. - * - * @param \Tx_Phpunit_Service_OutputService $outputService the output service to inject - * - * @return void - */ - public function injectOutputService(\Tx_Phpunit_Service_OutputService $outputService) - { - $this->outputService = $outputService; - } - - /** - * Sets the total number of tests to run (used for displaying the progress - * bar). - * - * @param int $totalNumberOfTests - * the total number of tests to run, must be >= 0 - * - * @return void - */ - public function setTotalNumberOfTests($totalNumberOfTests) - { - $this->totalNumberOfTests = $totalNumberOfTests; - } - - /** - * Gets the total number of tests that were detected to come from data providers. - * - * Note: As these are detected based on similar names, the first test from a data - * provider cannot be detected reliably; the number will always be too low. - * - * @return int the total number of data-provider related tests detected so far, will be >= 0 - */ - public function getTotalNumberOfDetectedDataProviderTests() - { - return $this->totalNumberOfDetectedDataProviderTests; - } - - /** - * Enables the option to use human-readable test and test case names. - * - * @return void - */ - public function useHumanReadableTextFormat() - { - $this->useHumanReadableTextFormat = true; - } - - /** - * An error has occurred, i.e. an exception has been thrown when running $test. - * - * @param \PHPUnit_Framework_Test $test the test that had an error - * @param \Exception $e the exception that has caused the error - * @param float $time ? - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) - { - if (!$test instanceof \PHPUnit_Framework_TestCase) { - throw new \InvalidArgumentException( - 'addError needs $test to be a \\PHPUnit_Framework_TestCase.', - 1334308922 - ); - } - /** @var \PHPUnit_Framework_TestCase $test */ - $fileName = str_replace(PATH_site, '', $e->getFile()); - $lineNumber = $e->getLine(); - - $this->outputService->output( - '' . - '' . - '! Error in test case ' . - htmlspecialchars($test->getName(), ENT_HTML5 | ENT_QUOTES) . '
File: ' . $fileName . '' . - '
Line: ' . $lineNumber . '' . - '
' . nl2br(htmlspecialchars($e->getMessage(), ENT_HTML5 | ENT_QUOTES)) . '
' - ); - $this->outputService->flushOutputBuffer(); - } - - /** - * A risky test has been detected. - * - * @param \PHPUnit_Framework_Test $test - * @param \Exception $e - * @param float $time - * - * @return void - */ - public function addRiskyTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) - { - // We don't treat those kind of tests yet. - } - - /** - * A test has failed. - * - * @param \PHPUnit_Framework_Test $test the test that has failed - * @param \PHPUnit_Framework_AssertionFailedError $e the failed assertion - * @param float $time ? - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) - { - if (!$test instanceof \PHPUnit_Framework_TestCase) { - throw new \InvalidArgumentException( - 'addFailure needs $test to be a \\PHPUnit_Framework_TestCase.', - 1334308954 - ); - } - /** @var \PHPUnit_Framework_TestCase $test */ - $testCaseTraceArr = $this->getFirstNonPhpUnitTrace($e->getTrace()); - $fileName = str_replace(PATH_site, '', $testCaseTraceArr['file']); - - $this->outputService->output( - '' . - '' . - 'Failure in test case ' . htmlspecialchars($test->getName(), ENT_HTML5 | ENT_QUOTES) . '' . - '
File: ' . $fileName . '' . - '
Line: ' . $testCaseTraceArr['line'] . '' - ); - - if (method_exists($e, 'getDescription')) { - $message = $e->getDescription(); - } else { - $message = $e->getMessage(); - } - $this->outputService->output('
' . nl2br(htmlspecialchars($message, ENT_HTML5 | ENT_QUOTES)) . '
'); - - if ($e instanceof \PHPUnit_Framework_ExpectationFailedException) { - /** @var \PHPUnit_Framework_ExpectationFailedException $e */ - $comparisonFailure = $e->getComparisonFailure(); - if ($comparisonFailure instanceof ComparisonFailure) { - /** @var ComparisonFailure $comparisonFailure */ - $expected = $comparisonFailure->getExpectedAsString(); - $actual = $comparisonFailure->getActualAsString(); - - /** @var DiffUtility $diff */ - $diff = GeneralUtility::makeInstance(DiffUtility::class); - $this->outputService->output('' . $diff->makeDiffDisplay($actual, $expected) . ''); - } - } - } - - /** - * Returns the first trace information which is not caused by the PHPUnit file - * "Framework/Assert.php". - * - * @param array[] $traceData the trace data - * - * @return array trace information - */ - protected function getFirstNonPhpUnitTrace(array $traceData) - { - $testCaseTraceData = []; - - foreach ($traceData as $singleTraceArr) { - if (stripos(GeneralUtility::fixWindowsFilePath($singleTraceArr['file']), 'Framework/Assert.php') - === false) { - $testCaseTraceData = $singleTraceArr; - break; - } - } - - return $testCaseTraceData; - } - - /** - * A test has been marked as incomplete, i.e. as not implemented yet. - * - * @param \PHPUnit_Framework_Test $test the test that has been marked as incomplete - * @param \Exception $e an exception about the incomplete test (?) - * @param float $time ? - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) - { - if (!$test instanceof \PHPUnit_Framework_TestCase) { - throw new \InvalidArgumentException( - 'addIncompleteTest needs $test to be a \\PHPUnit_Framework_TestCase.', - 1334308983 - ); - } - /** @var \PHPUnit_Framework_TestCase $test */ - $this->outputService->output( - '' . - '' . - 'Incomplete test ' . htmlspecialchars($test->getName(), ENT_HTML5 | ENT_QUOTES) . - ' in file ' . $e->getFile() . ' line ' . $e->getLine() . ':
' . - htmlspecialchars($e->getMessage(), ENT_HTML5 | ENT_QUOTES) . '
' - ); - } - - /** - * A test has been marked as skipped. - * - * @param \PHPUnit_Framework_Test $test the test that has been marked as skipped - * @param \Exception $e an exception about the skipped test (?) - * @param float $time ? - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) - { - if (!$test instanceof \PHPUnit_Framework_TestCase) { - throw new \InvalidArgumentException( - 'addSkippedTest needs $test to be a \\PHPUnit_Framework_TestCase.', - 1334309006 - ); - } - /** @var \PHPUnit_Framework_TestCase $test */ - $this->outputService->output( - '' . - '' . - 'Skipped test ' . htmlspecialchars($test->getName(), ENT_HTML5 | ENT_QUOTES) . ' in file ' . - $e->getFile() . ' line ' . $e->getLine() . ':
' . - htmlspecialchars($e->getMessage(), ENT_HTML5 | ENT_QUOTES) . '
' - ); - } - - /** - * A test suite/case has started. - * - * Note: This function also gets called when a test that uses a data provider - * has started. - * - * @param \PHPUnit_Framework_TestSuite $suite the test suite/case that has started - * - * @return void - */ - public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) - { - $this->setTestSuiteName($suite->getName()); - if (($suite instanceof \PHPUnit_Framework_TestSuite_DataProvider) - || ($suite->getName() === 'tx_phpunit_basetestsuite') - ) { - return; - } - - $this->outputService->output( - '

Testsuite: ' . htmlspecialchars($this->prettifyTestClass($suite->getName()), ENT_HTML5 | ENT_QUOTES) - . '

' . - '' - ); - } - - /** - * Sets the name of the test suite that is used for creating the re-run - * link. - * - * @param string $name the name of the test suite, must not be empty - * - * @return void - */ - public function setTestSuiteName($name) - { - $this->currentTestCaseName = $name; - } - - /** - * A test suite/case has ended. - * - * Note: This function also gets called when a test that uses a data provider - * has ended. - * - * @param \PHPUnit_Framework_TestSuite $suite the test suite/case that has ended - * - * @return void - */ - public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) - { - } - - /** - * A test has started. - * - * @param \PHPUnit_Framework_Test $test the test that has started - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function startTest(\PHPUnit_Framework_Test $test) - { - if (!$test instanceof \PHPUnit_Framework_TestCase) { - throw new \InvalidArgumentException( - 'For startTest, $test needs to be a \\PHPUnit_Framework_TestCase.', - 1334305913 - ); - } - /** @var \PHPUnit_Framework_TestCase $test */ - - // A single test has to take less than this or else PHP will time out. - $this->setTimeLimit(240); - - $this->outputService->output( - '
' . - '

' . $this->createReRunLink($test) . htmlspecialchars($this->prettifyTestMethod($test->getName()), ENT_HTML5 | ENT_QUOTES) - . '

' - ); - $this->memoryUsageStartOfTest = memory_get_usage(); - } - - /** - * Sets the PHP execution time limit. - * - * @param int $limit the PHP execution time limit in seconds, must be >= 0 - * - * @return void - */ - protected function setTimeLimit($limit) - { - set_time_limit($limit); - } - - /** - * A test has ended. - * - * @param \PHPUnit_Framework_Test $test the test that has ended - * @param float $time ? - * - * @return void - */ - public function endTest(\PHPUnit_Framework_Test $test, $time) - { - $this->memoryUsageEndOfTest = memory_get_usage(); - - if ($test instanceof \PHPUnit_Framework_TestCase) { - /** @var \PHPUnit_Framework_TestCase $test */ - // Tests with the same name are a sign of data provider usage. - $testNameParts = explode(' ', $test->getName()); - $testName = get_class($test) . ':' . $testNameParts[0]; - if ($testName !== $this->previousTestName) { - $this->currentDataProviderNumber = 0; - $this->currentTestNumber++; - $this->previousTestName = $testName; - } else { - $this->currentDataProviderNumber++; - $this->totalNumberOfDetectedDataProviderTests++; - } - } - - if (($this->totalNumberOfTests - $this->totalNumberOfDetectedDataProviderTests) > 0) { - $percentDone = 100.0 * $this->currentTestNumber / - ($this->totalNumberOfTests - $this->totalNumberOfDetectedDataProviderTests); - } else { - $percentDone = 0.0; - } - - if ($test instanceof \PHPUnit_Framework_TestCase) { - $this->testAssertions += $test->getNumAssertions(); - } - - $output = '
'; - $output .= '
' . - ''; - - $this->outputService->output($output); - $this->outputService->flushOutputBuffer(); - } - - /** - * Creates the link (including an icon) to re-run the given single test. - * - * @param \PHPUnit_Framework_TestCase $test - * the test for which to create the re-run link - * - * @return string the link to re-run the given test, will not be empty - */ - protected function createReRunLink(\PHPUnit_Framework_TestCase $test) - { - $iconImageTag = ''; - return '' . $iconImageTag . ' '; - } - - /** - * Creates the URL to re-run the given test. - * - * @param \PHPUnit_Framework_TestCase $test - * the test for which to create the re-run URL - * - * @return string the htmlspecialchared URL to re-run the given test, will not be empty - */ - protected function createReRunUrl(\PHPUnit_Framework_TestCase $test) - { - $urlParameters = [ - \Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE . - '[' . \Tx_Phpunit_Interface_Request::PARAMETER_KEY_COMMAND . ']' => 'runsingletest', - \Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE . - '[' . \Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTCASE . ']' => $this->getTestCaseName(), - \Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE . - '[' . \Tx_Phpunit_Interface_Request::PARAMETER_KEY_TEST . ']' => $this->createTestId($test), - ]; - - return htmlspecialchars( - BackendUtility::getModuleUrl( - \Tx_Phpunit_BackEnd_Module::MODULE_NAME, - $urlParameters - ), - ENT_HTML5 | ENT_QUOTES - ); - } - - /** - * Creates a unique string ID for $test that can be used in URLs. - * - * @param \PHPUnit_Framework_TestCase $test a test for which to create an ID - * - * @return string a unique ID for $test, not htmlspecialchared or URL-encoded yet - */ - protected function createTestId(\PHPUnit_Framework_TestCase $test) - { - $testNameParts = explode(' ', $test->getName()); - - // This is quite a hack. - if (strpos($this->currentTestCaseName, '::') !== false) { - $result = $testNameParts[0] . '(' . $this->getTestCaseName() . ')'; - } else { - $result = $this->getTestCaseName() . '::' . $testNameParts[0]; - } - - return $result; - } - - /** - * Gets the current test case name. - * - * @return string the current test case name, will not be empty - */ - protected function getTestCaseName() - { - $testCaseNameParts = explode('::', $this->currentTestCaseName); - - return $testCaseNameParts[0]; - } - - /** - * Prettifies the name of a test method. - * - * This method will return $testName unchanged if human-readable names - * are disabled. - * - * @param string $testName a camel-case test name, must not be empty - * - * @return string the prettified test name, will not be empty - */ - protected function prettifyTestMethod($testName) - { - if (!$this->useHumanReadableTextFormat) { - return $testName; - } - - // this is required because the "setPrefix" work not very well with the prefix "test_" - $testNameWithoutSuffix = preg_replace('/^test_/i', '', $testName); - - $this->namePrettifier->setPrefix('test'); - $this->namePrettifier->setSuffix(null); - - return $this->namePrettifier->prettifyTestMethod($testNameWithoutSuffix); - } - - /** - * Prettifies the name of a test class. - * - * This method will return $testClass unchanged if human-readable names - * are disabled. - * - * @param string $testClassName a camel-case test class name, must not be empty - * - * @return string the prettified test class name, will not be empty - */ - protected function prettifyTestClass($testClassName) - { - if (!$this->useHumanReadableTextFormat) { - return $testClassName; - } - - $testClassNameWithoutPrefixOrSuffix = preg_replace('/(tx_|Tx_)?(.+)(Test|_testcase)$/', '\\2', $testClassName); - $testClassNameWithoutUnderScores = str_replace('_', ' ', $testClassNameWithoutPrefixOrSuffix); - - $this->namePrettifier->setPrefix(null); - $this->namePrettifier->setSuffix(null); - - return $this->namePrettifier->prettifyTestClass($testClassNameWithoutUnderScores); - } - - /** - * Retrieves the collected amount of processed assertions. - * - * @return int the number of executed assertions, will be >= 0 - */ - public function assertionCount() - { - return $this->testAssertions; - } -} diff --git a/Classes/BackEnd/conf.php b/Classes/BackEnd/conf.php deleted file mode 100644 index 65e78829..00000000 --- a/Classes/BackEnd/conf.php +++ /dev/null @@ -1,8 +0,0 @@ - - * @author Oliver Klee - */ -defined('TYPO3_MODE') or die('Access denied.'); - -LibraryLoader::includeAll(); - -/** @var \TYPO3\CMS\Lang\LanguageService $languageService */ -$languageService = $GLOBALS['LANG']; -$languageService->includeLLFile('EXT:phpunit/Resources/Private/Language/locallang_backend.xlf'); - -$namePrettifier = new \PHPUnit_Util_TestDox_NamePrettifier(); - -/** @var \Tx_Phpunit_Service_OutputService $outputService */ -$outputService = GeneralUtility::makeInstance(\Tx_Phpunit_Service_OutputService::class); - -/** @var \Tx_Phpunit_Service_UserSettingsService $userSettingsService */ -$userSettingsService = GeneralUtility::makeInstance(\Tx_Phpunit_Service_UserSettingsService::class); - -/** @var \Tx_Phpunit_BackEnd_TestListener $testListener */ -$testListener = GeneralUtility::makeInstance(\Tx_Phpunit_BackEnd_TestListener::class); -$testListener->injectNamePrettifier($namePrettifier); -$testListener->injectOutputService($outputService); - -/** @var \Tx_Phpunit_Service_ExtensionSettingsService $extensionSettingsService */ -$extensionSettingsService = GeneralUtility::makeInstance(\Tx_Phpunit_Service_ExtensionSettingsService::class); - -/** @var \Tx_Phpunit_Service_UserSettingsService $userSettingsService */ -$userSettingsService = GeneralUtility::makeInstance(\Tx_Phpunit_Service_UserSettingsService::class); - -/** @var \Tx_Phpunit_Service_TestCaseService $testCaseService */ -$testCaseService = GeneralUtility::makeInstance(\Tx_Phpunit_Service_TestCaseService::class); -$testCaseService->injectUserSettingsService($userSettingsService); - -/** @var \Tx_Phpunit_Service_TestFinder $testFinder */ -$testFinder = GeneralUtility::makeInstance(\Tx_Phpunit_Service_TestFinder::class); -$testFinder->injectExtensionSettingsService($extensionSettingsService); - -/** @var \Tx_Phpunit_BackEnd_Request $request */ -$request = GeneralUtility::makeInstance(\Tx_Phpunit_BackEnd_Request::class); - -/** @var \PHPUnit_Util_TestDox_NamePrettifier */ -$namePrettifier = GeneralUtility::makeInstance(\PHPUnit_Util_TestDox_NamePrettifier::class); - -/** @var \Tx_Phpunit_BackEnd_Module $module */ -$module = GeneralUtility::makeInstance(\Tx_Phpunit_BackEnd_Module::class); -$module->injectRequest($request); -$module->injectNamePrettifier($namePrettifier); -$module->injectOutputService($outputService); -$module->injectUserSettingsService($userSettingsService); -$module->injectTestListener($testListener); -$module->injectTestFinder($testFinder); -$module->injectTestCaseService($testCaseService); -$module->main(); diff --git a/Classes/Exception/NoTestsDirectory.php b/Classes/Exception/NoTestsDirectory.php deleted file mode 100644 index da45508d..00000000 --- a/Classes/Exception/NoTestsDirectory.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ -class Tx_Phpunit_Exception_NoTestsDirectory extends \Exception -{ -} diff --git a/Classes/Interface/ConvertService.php b/Classes/Interface/ConvertService.php deleted file mode 100644 index 0438853b..00000000 --- a/Classes/Interface/ConvertService.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @author Oliver Klee - */ -interface Tx_Phpunit_Interface_ConvertService -{ - /** - * Returns the boolean value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return bool the value for the given key, will be FALSE if there is no value for the given key - */ - public function getAsBoolean($key); - - /** - * Returns the integer value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return int the value for the given key, will be 0 if there is no value for the given key - */ - public function getAsInteger($key); - - /** - * Checks whether there is a non-zero integer for $key. - * - * @param string $key the key of the value to check, must not be empty - * - * @return bool whether there is a non-zero integer for $key - */ - public function hasInteger($key); - - /** - * Returns the string value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return string the value for the given key, will be "" if there is no value for the given key - */ - public function getAsString($key); - - /** - * Checks whether there is a non-empty string for $key. - * - * @param string $key the key of the value to check, must not be empty - * - * @return bool whether there is a non-empty string for $key - */ - public function hasString($key); - - /** - * Returns the array value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return array the value for the given key, will be empty if there is no array value for the given key - */ - public function getAsArray($key); -} diff --git a/Classes/Interface/ExtensionSettingsService.php b/Classes/Interface/ExtensionSettingsService.php deleted file mode 100644 index c4ad0b04..00000000 --- a/Classes/Interface/ExtensionSettingsService.php +++ /dev/null @@ -1,13 +0,0 @@ - - */ -interface Tx_Phpunit_Interface_ExtensionSettingsService extends \Tx_Phpunit_Interface_ConvertService -{ -} diff --git a/Classes/Interface/Request.php b/Classes/Interface/Request.php deleted file mode 100644 index d1b07bc4..00000000 --- a/Classes/Interface/Request.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -interface Tx_Phpunit_Interface_Request extends \Tx_Phpunit_Interface_ConvertService -{ - /** - * @var string - */ - const PARAMETER_NAMESPACE = 'tx_phpunit'; - - /** - * @var string - */ - const PARAMETER_KEY_COMMAND = 'command'; - - /** - * @var string - */ - const PARAMETER_KEY_TESTABLE = 'extSel'; - - /** - * @var string - */ - const PARAMETER_KEY_TESTCASE = 'testCaseFile'; - - /** - * @var string - */ - const PARAMETER_KEY_TEST = 'testname'; - - /** - * @var string - */ - const PARAMETER_KEY_EXECUTE = 'bingo'; -} diff --git a/Classes/Interface/UserSettingsService.php b/Classes/Interface/UserSettingsService.php deleted file mode 100644 index a02bb75a..00000000 --- a/Classes/Interface/UserSettingsService.php +++ /dev/null @@ -1,22 +0,0 @@ - - */ -interface Tx_Phpunit_Interface_UserSettingsService extends \Tx_Phpunit_Interface_ConvertService -{ - /** - * Sets the value for the key $key. - * - * @param string $key the key of the value to set, must not be empty - * @param mixed $value the value to set - * - * @return void - */ - public function set($key, $value); -} diff --git a/Classes/Service/ExtensionSettingsService.php b/Classes/Service/ExtensionSettingsService.php deleted file mode 100644 index 03498c71..00000000 --- a/Classes/Service/ExtensionSettingsService.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ -class Tx_Phpunit_Service_ExtensionSettingsService extends \Tx_Phpunit_AbstractDataContainer implements \Tx_Phpunit_Interface_ExtensionSettingsService, SingletonInterface -{ - /** - * @var array - */ - private $cachedSettings = []; - - /** - * @var bool - */ - private $settingsHaveBeenRetrieved = false; - - /** - * Returns the value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return mixed the value for the given key, will be NULL if there is no value for the given key - */ - protected function get($key) - { - $this->checkForNonEmptyKey($key); - if (!$this->settingsHaveBeenRetrieved) { - $this->retrieveSettings(); - } - if (!isset($this->cachedSettings[$key])) { - return null; - } - - return $this->cachedSettings[$key]; - } - - /** - * Retrieves the EM configuration for the PHPUnit extension. - * - * @return void - */ - protected function retrieveSettings() - { - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['phpunit'])) { - $this->cachedSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['phpunit']); - } else { - $this->cachedSettings = []; - } - - $this->settingsHaveBeenRetrieved = true; - } -} diff --git a/Classes/Service/FakeOutputService.php b/Classes/Service/FakeOutputService.php deleted file mode 100644 index d11b4459..00000000 --- a/Classes/Service/FakeOutputService.php +++ /dev/null @@ -1,63 +0,0 @@ - - */ -class Tx_Phpunit_Service_FakeOutputService extends \Tx_Phpunit_Service_OutputService -{ - /** - * @var string - */ - protected $collectedOutput = ''; - - /** - * @var int - */ - protected $numberOfFlushCalls = 0; - - /** - * Collects $output, but does not actually echo it. - * - * @param string $output a string to store, may be empty - * - * @return void - */ - public function output($output) - { - $this->collectedOutput .= $output; - } - - /** - * Returns the collected output from all calls to output. - * - * @return string the collected output, might be empty - */ - public function getCollectedOutput() - { - return $this->collectedOutput; - } - - /** - * Does not really flush the output buffer, but just counts the number of calls to this function. - * - * @return void - */ - public function flushOutputBuffer() - { - $this->numberOfFlushCalls++; - } - - /** - * Returns how often flushOutputBuffer already has been called for this instance. - * - * @return int the number of calls, will be >= 0 - */ - public function getNumberOfFlushCalls() - { - return $this->numberOfFlushCalls; - } -} diff --git a/Classes/Service/OutputService.php b/Classes/Service/OutputService.php deleted file mode 100644 index 0aa28c86..00000000 --- a/Classes/Service/OutputService.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class Tx_Phpunit_Service_OutputService implements SingletonInterface -{ - /** - * Echoes $output. - * - * @param string $output a string to echo, may be empty - * - * @return void - */ - public function output($output) - { - echo $output; - } - - /** - * Flushes the output buffer. - * - * @return void - */ - public function flushOutputBuffer() - { - flush(); - } -} diff --git a/Classes/Service/TestCaseService.php b/Classes/Service/TestCaseService.php deleted file mode 100644 index 181a7602..00000000 --- a/Classes/Service/TestCaseService.php +++ /dev/null @@ -1,205 +0,0 @@ - - */ -class Tx_Phpunit_Service_TestCaseService implements SingletonInterface -{ - /** - * @var string - */ - const BASE_TEST_CASE_CLASS_NAME = 'PHPUnit_Framework_TestCase'; - - /** - * suffixes that indicate that a file is a test case - * - * @var string[] - */ - protected static $testCaseFileSuffixes = [ - 'Test.php', - 'test.php', - '_testcase.php', - 'testcase.php', - ]; - - /** - * class name suffixes that indicate that a class is a test case - * - * @var string[] - */ - protected static $testCaseClassNameSuffixes = [ - 'Test', - '_testcase', - ]; - - /** - * @var \Tx_Phpunit_Interface_UserSettingsService - */ - protected $userSettingsService = null; - - /** - * Injects the user settings service. - * - * @param \Tx_Phpunit_Interface_UserSettingsService $service the service to inject - * - * @return void - */ - public function injectUserSettingsService(\Tx_Phpunit_Interface_UserSettingsService $service) - { - $this->userSettingsService = $service; - } - - /** - * Finds all files that are named like test files in the directory $directory - * and recursively all its subdirectories. - * - * @param string $directory - * the absolute path of the directory in which to look for test cases - * - * @return string[] - * sorted file names of the test cases in the directory $directory relative - * to $directory, will be empty if no test cases have been found - * - * @throws \InvalidArgumentException - */ - public function findTestCaseFilesInDirectory($directory) - { - if ($directory === '') { - throw new \InvalidArgumentException('$directory must not be empty.', 1334439798); - } - if (!is_dir($directory)) { - throw new \InvalidArgumentException('The directory ' . $directory . ' does not exist.', 1334439804); - } - if (!is_readable($directory)) { - throw new \InvalidArgumentException( - 'The directory ' . $directory . ' exists, but is not readable.', - 1334439813 - ); - } - - $directoryLength = strlen($directory); - - $testFiles = []; - $allPhpFiles = GeneralUtility::getAllFilesAndFoldersInPath([], $directory, 'php'); - foreach ($allPhpFiles as $filePath) { - if ($this->isNotFixturesPath($filePath) && $this->isTestCaseFileName($filePath)) { - $testFiles[] = substr($filePath, $directoryLength); - } - } - - sort($testFiles, SORT_STRING); - - return $testFiles; - } - - /** - * Checks that a path does not contain "Fixtures" or "fixtures". - * - * @param string $path the absolute path of a file to check, may be empty - * - * @return bool TRUE if $fileName is a valid test case path, FALSE otherwise - */ - protected function isNotFixturesPath($path) - { - return stripos($path, '/fixtures/') === false; - } - - /** - * Checks whether a file name is named like a test case file name should be. - * - * @param string $path the absolute path of a file to check - * - * @return bool TRUE if $fileName is names like a proper test case, FALSE otherwise - */ - public function isTestCaseFileName($path) - { - $fileName = basename($path); - if ($this->isHiddenMacFile($fileName)) { - return false; - } - - $isTestCase = false; - foreach (self::$testCaseFileSuffixes as $suffix) { - if (substr($fileName, -strlen($suffix)) === $suffix) { - $isTestCase = true; - break; - } - } - - return $isTestCase; - } - - /** - * Checks whether $fileName is a hidden Mac file. - * - * @param string $fileName base name of a file to check - * - * @return bool TRUE if $fileName is a hidden Mac file, FALSE otherwise - */ - protected function isHiddenMacFile($fileName) - { - return strncmp($fileName, '._', 2) === 0; - } - - /** - * Checks whether $className is the name of a valid test case class, i.e., whether it follows the naming guidelines, - * is a subclass of one of the test base classes, is not one of the base classes itself and is not abstract. - * - * @param string $className the class name to check, must not be empty - * - * @return bool whether $className is the name of a valid test case class - * - * @throws \InvalidArgumentException - */ - public function isValidTestCaseClassName($className) - { - if ($className === '') { - throw new \InvalidArgumentException('$className must not be empty.', 1354018635); - } - - return $this->classNameHasTestCaseSuffix($className) && class_exists($className) - && $this->classNameIsNonAbstractSubclassOfValidBaseTestCase($className); - } - - /** - * Checks whether a class name has a name suffix that is allowed for test cases. - * - * @param string $className the class name to check, must not be empty - * - * @return bool whether the class name has a suffix that is supported for test cases - */ - protected function classNameHasTestCaseSuffix($className) - { - $hasTestCaseSuffix = false; - - foreach (self::$testCaseClassNameSuffixes as $suffixToCheck) { - if (substr($className, -strlen($suffixToCheck)) === $suffixToCheck) { - $hasTestCaseSuffix = true; - break; - } - } - - return $hasTestCaseSuffix; - } - - /** - * Checks whether $className is the name of a non-abstract subclass of the test case base class. - * - * @param string $className the class name to check, must not be empty - * - * @return bool whether the corresponding class is both non-abstract and a subclass of the test case base class - */ - protected function classNameIsNonAbstractSubclassOfValidBaseTestCase($className) - { - $classReflection = new \ReflectionClass($className); - - return !$classReflection->isAbstract() && $classReflection->isSubclassOf(self::BASE_TEST_CASE_CLASS_NAME); - } -} diff --git a/Classes/Service/TestFinder.php b/Classes/Service/TestFinder.php deleted file mode 100644 index 865848ca..00000000 --- a/Classes/Service/TestFinder.php +++ /dev/null @@ -1,292 +0,0 @@ - - */ -class Tx_Phpunit_Service_TestFinder implements SingletonInterface -{ - /** - * allowed test directory names - * - * @var string[] - */ - protected static $allowedTestDirectoryNames = ['Tests/', 'tests/']; - - /** - * keys of the dummy extensions of the phpunit extension - * - * @var string[] - */ - protected static $dummyExtensionKeys = ['aaa', 'bbb', 'ccc', 'ddd']; - - /** - * the cached result of findTestableForEverything - * - * @var \Tx_Phpunit_Testable[] - */ - protected $allTestables = []; - - /** - * indicates whether $allTestables already has been filled - * - * @var bool - */ - protected $allTestablesAreCached = false; - - /** - * @var \Tx_Phpunit_Interface_ExtensionSettingsService - */ - protected $extensionSettingsService = null; - - /** - * Injects the extension settings service. - * - * @param \Tx_Phpunit_Interface_ExtensionSettingsService $service the service to inject - * - * @return void - */ - public function injectExtensionSettingsService(\Tx_Phpunit_Interface_ExtensionSettingsService $service) - { - $this->extensionSettingsService = $service; - } - - /** - * Checks whether there is testable code for a key. - * - * @param string $key - * the key to check, might be an extension key or any other string (even an empty string) - * - * @return bool TRUE if there is testable code with the given key, FALSE otherwise - */ - public function existsTestableForKey($key) - { - if ($key === '') { - return false; - } - - $allTestables = $this->getTestablesForEverything(); - - return isset($allTestables[$key]); - } - - /** - * Checks whether there is at least one tests directory in at least one extension. - * - * @return bool - * TRUE if there ist at least one test directory, FALSE otherwise - */ - public function existsTestableForAnything() - { - $testablesForEverything = $this->getTestablesForEverything(); - - return !empty($testablesForEverything); - } - - /** - * Returns the testable code for the given key. - * - * @param string $key - * the key for which to get the testable, must an extension key, must not be empty - * - * @return \Tx_Phpunit_Testable the testable for the given key - * - * @throws \InvalidArgumentException - * @throws \BadMethodCallException - */ - public function getTestableForKey($key) - { - if ($key === '') { - throw new \InvalidArgumentException('$key must not be empty.', 1334664441); - } - if (!$this->existsTestableForKey($key)) { - throw new \BadMethodCallException('There is no testable for this key: ' . $key, 1334664552); - } - - $allTestables = $this->getTestablesForEverything(); - return $allTestables[$key]; - } - - /** - * Returns the testable code instance for everything, i.e., all installed extensions. - * - * @return \Tx_Phpunit_Testable[] - * testable code for everything using the extension keys as array keys, might be empty - */ - public function getTestablesForEverything() - { - if (!$this->allTestablesAreCached) { - $this->allTestables = $this->getTestablesForExtensions(); - $this->allTestablesAreCached = true; - } - - return $this->allTestables; - } - - /** - * Returns the testable code for all installed extensions, sorted in - * alphabetical order by extension name. - * - * Extensions without a test directory and extensions in the "exclude list" - * will be skipped. - * - * @return \Tx_Phpunit_Testable[] - * testable code for the installed extensions using the extension keys - * as array keys, might be empty - */ - public function getTestablesForExtensions() - { - $result = []; - - $extensionKeysToExamine = array_diff( - $this->getLoadedExtensionKeys(), - $this->getExcludedExtensionKeys(), - $this->getDummyExtensionKeys() - ); - - foreach ($extensionKeysToExamine as $extensionKey) { - try { - $result[$extensionKey] = $this->createTestableForSingleExtension($extensionKey); - } catch (\Tx_Phpunit_Exception_NoTestsDirectory $exception) { - // Just skip extensions without a tests directory. - } - } - - uasort($result, [$this, 'sortTestablesByKey']); - - return $result; - } - - /** - * Callback function for comparing the keys of $testable1 and $testable2. - * - * @param \Tx_Phpunit_Testable $testable1 the first item to compare - * @param \Tx_Phpunit_Testable $testable2 the second item to compare - * - * @return int - * 1 if both items need to be swapped, 0 if they have the same key, - * and -1 if the order is okay. - */ - public function sortTestablesByKey(\Tx_Phpunit_Testable $testable1, \Tx_Phpunit_Testable $testable2) - { - return strcmp($testable1->getKey(), $testable2->getKey()); - } - - /** - * Returns the keys of the loaded extensions. - * - * @return string[] the keys of the loaded extensions, might be empty - */ - protected function getLoadedExtensionKeys() - { - return ExtensionManagementUtility::getLoadedExtensionListArray(); - } - - /** - * Returns the keys of the extensions excluded from unit testing via the - * phpunit configuration. - * - * @return string[] the keys of the excluded extensions, might be empty - */ - protected function getExcludedExtensionKeys() - { - return GeneralUtility::trimExplode( - ',', - $this->extensionSettingsService->getAsString('excludeextensions'), - true - ); - } - - /** - * Returns the keys of the extensions excluded from unit testing because - * they are the dummy extensions of phpunit. - * - * @return string[] the keys of the dummy extensions, will not be empty - */ - public function getDummyExtensionKeys() - { - return self::$dummyExtensionKeys; - } - - /** - * Creates the testable code instance for the extension with the given key. - * - * @param string $extensionKey the key of an installed extension, must not be empty - * - * @return \Tx_Phpunit_Testable the test-relevant data of the installed extension - * - * @throws \Tx_Phpunit_Exception_NoTestsDirectory if the given extension has no tests directory - */ - protected function createTestableForSingleExtension($extensionKey) - { - $testsPath = $this->findTestsPathForExtension($extensionKey); - - /** @var \Tx_Phpunit_Testable $testable */ - $testable = GeneralUtility::makeInstance(\Tx_Phpunit_Testable::class); - $testable->setKey($extensionKey); - $testable->setTitle($extensionKey); - $testable->setCodePath(ExtensionManagementUtility::extPath($extensionKey)); - $testable->setTestsPath($testsPath); - foreach (['ext_icon.gif', 'ext_icon.png'] as $fileNameCandidate) { - if (file_exists(ExtensionManagementUtility::extPath($extensionKey) . $fileNameCandidate)) { - $iconPath = - PathUtility::getAbsoluteWebPath('../typo3conf/ext/' . $extensionKey . '/' . $fileNameCandidate); - $testable->setIconPath($iconPath); - break; - } - } - - return $testable; - } - - /** - * Finds the absolute path to the tests of the extension with the key $extensionKey. - * - * @param string $extensionKey the key of an installed extension, must not be empty - * - * @return string - * the absolute path of the tests directory of the given extension - * (might differ in case from the actual tests directory on case-insensitive - * file systems) - * - * @throws \InvalidArgumentException - * @throws \Tx_Phpunit_Exception_NoTestsDirectory if the given extension has no tests directory - */ - protected function findTestsPathForExtension($extensionKey) - { - if ($extensionKey === '') { - throw new \InvalidArgumentException('$extensionKey must not be empty.', 1334439819); - } - - $testsPath = ''; - try { - $extensionPath = ExtensionManagementUtility::extPath($extensionKey); - - foreach (self::$allowedTestDirectoryNames as $testDirectoryName) { - if (is_dir($extensionPath . $testDirectoryName)) { - $testsPath = $extensionPath . $testDirectoryName; - break; - } - } - } catch (\BadFunctionCallException $e) { - // Silently ignore missing extensions (e.g. extension directory does not exist) - } - - if ($testsPath === '') { - throw new \Tx_Phpunit_Exception_NoTestsDirectory( - 'The extension "' . $extensionKey . '" does not have a tests directory.', - 1334439826 - ); - } - - return $testsPath; - } -} diff --git a/Classes/Service/UserSettingsService.php b/Classes/Service/UserSettingsService.php deleted file mode 100644 index 0c07dc00..00000000 --- a/Classes/Service/UserSettingsService.php +++ /dev/null @@ -1,85 +0,0 @@ - - */ -class Tx_Phpunit_Service_UserSettingsService extends \Tx_Phpunit_AbstractDataContainer implements \Tx_Phpunit_Interface_UserSettingsService, SingletonInterface -{ - /** - * @var string - */ - const PHPUNIT_SETTINGS_KEY = 'Tx_Phpunit_BackEndSettings'; - - /** - * Returns the value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return mixed the value for the given key, will be NULL if there is no value for the given key - */ - protected function get($key) - { - $this->checkForNonEmptyKey($key); - if (!isset($this->getBackEndUser()->uc[self::PHPUNIT_SETTINGS_KEY][$key])) { - return null; - } - - return $this->getBackEndUser()->uc[self::PHPUNIT_SETTINGS_KEY][$key]; - } - - /** - * Sets the value for the key $key. - * - * @param string $key the key of the value to set, must not be empty - * @param mixed $value the value to set - * - * @return void - */ - public function set($key, $value) - { - $this->checkForNonEmptyKey($key); - - $this->getBackEndUser()->uc[self::PHPUNIT_SETTINGS_KEY][$key] = $value; - $this->getBackEndUser()->writeUC(); - } - - /** - * Returns whether the given setting is active/allowed. - * - * @param string $key - * - * @return bool - */ - public function isActive($key) - { - switch ($key) { - case 'thisSettingIsAlwaysInactive': - $isActive = false; - break; - default: - // If the given setting is not covered by any of the cases, it should be considered active. - $isActive = true; - } - - return $isActive; - } - - /** - * Returns $GLOBALS['BE_USER']. - * - * @return BackendUserAuthentication - */ - protected function getBackEndUser() - { - return $GLOBALS['BE_USER']; - } -} diff --git a/Classes/Testable.php b/Classes/Testable.php deleted file mode 100644 index 0a334b1c..00000000 --- a/Classes/Testable.php +++ /dev/null @@ -1,259 +0,0 @@ - - */ -class Tx_Phpunit_Testable -{ - /** - * @var string - */ - const ALL_EXTENSIONS = 'allExtensions'; - - /** - * @var string - */ - protected $key = ''; - - /** - * @var string - */ - protected $title = ''; - - /** - * @var string - */ - protected $codePath = ''; - - /** - * @var string - */ - protected $testsPath = ''; - - /** - * files that should be excluded from code coverage - * - * @var string[] - */ - protected $blacklist = []; - - /** - * files that should be included in code coverage - * - * @var string[] - */ - protected $whitelist = []; - - /** - * @var string - */ - protected $iconPath = ''; - - /** - * Returns the key. - * - * The key is intended to be used e.g., for drop-downs. - * - * For extensions, this will be the extension key. For out-of-line tests, this will be full path to the tested code. - * - * @return string the key, will not be empty - */ - public function getKey() - { - return $this->key; - } - - /** - * Sets the key. - * - * The key is intended to be used e.g., for drop-downs. - * - * For extensions, this must be the extension key. For out-of-line tests, this must be full path to the tested code. - * - * @param string $key the key, must not be empty - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function setKey($key) - { - if ($key === '') { - throw new \InvalidArgumentException('$key must not be empty.', 1334439650); - } - - $this->key = $key; - } - - /** - * Returns the display title. - * - * @return string the title, might be empty - */ - public function getTitle() - { - return $this->title; - } - - /** - * Sets the display title. - * - * @param string $title the title, may be empty - * - * @return void - */ - public function setTitle($title) - { - $this->title = $title; - } - - /** - * Returns the code path. - * - * This is the absolute path of the code that is tested. - * - * @return string the code path, will not be empty - */ - public function getCodePath() - { - return $this->codePath; - } - - /** - * Sets the code path. - * - * This is the absolute path of the code that is tested. - * - * @param string $codePath the code path, must not be empty - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function setCodePath($codePath) - { - if ($codePath === '') { - throw new \InvalidArgumentException('$codePath must not be empty.', 1334439668); - } - - $this->codePath = $codePath; - } - - /** - * Returns the tests path. - * - * This is the absolute path of the unit tests. Usually, this path is - * located within the code path. - * - * @return string the tests path, will not be empty - */ - public function getTestsPath() - { - return $this->testsPath; - } - - /** - * Sets the tests path. - * - * This is the absolute path of the unit tests. Usually, this path is - * located within the code path. - * - * @param string $testsPath the tests path, must not be empty - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function setTestsPath($testsPath) - { - if ($testsPath === '') { - throw new \InvalidArgumentException('$testsPath must not be empty.', 1334439674); - } - - $this->testsPath = $testsPath; - } - - /** - * Returns the blacklist, i.e., the absolute paths to the files that should - * be excluded from the code coverage report. - * - * @return string[] - * the absolute paths to the blacklisted files, might be empty - */ - public function getBlacklist() - { - return $this->blacklist; - } - - /** - * Sets the blacklist, i.e., the absolute paths to the files that should - * be excluded from the code coverage report. - * - * @param string[] $files - * the absolute paths to the blacklisted files, may be empty - * - * @return void - */ - public function setBlacklist(array $files) - { - $this->blacklist = $files; - } - - /** - * Returns the whitelist, i.e., the absolute paths to the files that should - * be included in the code coverage report. - * - * @return string[] - * the absolute paths to the whitelisted files, might be empty - */ - public function getWhitelist() - { - return $this->whitelist; - } - - /** - * Sets the whitelist, i.e., the absolute paths to the files that should - * be included in the code coverage report. - * - * @param string[] $files - * the absolute paths to the whitelisted files, may be empty - * - * @return void - */ - public function setWhitelist(array $files) - { - $this->whitelist = $files; - } - - /** - * Returns the relative path to the icon associated with this testable code. - * - * @return string the relative icon path, will not be empty - */ - public function getIconPath() - { - return $this->iconPath; - } - - /** - * Sets the relative path to the icon associated with this testable code. - * - * @param string $iconPath the icon path, must not be empty - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function setIconPath($iconPath) - { - if ($iconPath === '') { - throw new \InvalidArgumentException('$iconPath must not be empty.', 1334439681); - } - - $this->iconPath = $iconPath; - } -} diff --git a/Classes/TestingDataContainer.php b/Classes/TestingDataContainer.php deleted file mode 100644 index 8cf5d5ce..00000000 --- a/Classes/TestingDataContainer.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ -class Tx_Phpunit_TestingDataContainer extends \Tx_Phpunit_AbstractDataContainer implements - \Tx_Phpunit_Interface_UserSettingsService, - \Tx_Phpunit_Interface_ExtensionSettingsService, - \Tx_Phpunit_Interface_Request -{ - /** - * @var array - */ - protected $data = []; - - /** - * Returns the value stored for the key $key. - * - * @param string $key the key of the value to retrieve, must not be empty - * - * @return mixed the value for the given key, will be NULL if there is no value for the given key - */ - protected function get($key) - { - $this->checkForNonEmptyKey($key); - if (!isset($this->data[$key])) { - return null; - } - - return $this->data[$key]; - } - - /** - * Sets the value for the key $key. - * - * @param string $key the key of the value to set, must not be empty - * @param mixed $value the value to set - * - * @return void - */ - public function set($key, $value) - { - $this->checkForNonEmptyKey($key); - - $this->data[$key] = $value; - } -} diff --git a/Classes/ViewHelpers/AbstractSelectorViewHelper.php b/Classes/ViewHelpers/AbstractSelectorViewHelper.php deleted file mode 100644 index e0520552..00000000 --- a/Classes/ViewHelpers/AbstractSelectorViewHelper.php +++ /dev/null @@ -1,104 +0,0 @@ - - */ -abstract class Tx_Phpunit_ViewHelpers_AbstractSelectorViewHelper extends \Tx_Phpunit_ViewHelpers_AbstractTagViewHelper -{ - /** - * @var \Tx_Phpunit_Interface_UserSettingsService - */ - protected $userSettingService = null; - - /** - * @var \Tx_Phpunit_Service_TestFinder - */ - protected $testFinder = null; - - /** - * @var string - */ - protected $action = ''; - - /** - * Injects the user setting service. - * - * @param \Tx_Phpunit_Interface_UserSettingsService $userSettingService - * - * @return void - */ - public function injectUserSettingService(\Tx_Phpunit_Interface_UserSettingsService $userSettingService) - { - $this->userSettingService = $userSettingService; - } - - /** - * Injects the test finder. - * - * @param \Tx_Phpunit_Service_TestFinder $testFinder - * - * @return void - */ - public function injectTestFinder($testFinder) - { - $this->testFinder = $testFinder; - } - - /** - * Sets the action for the form. - * - * @param string $action - * - * @return void - */ - public function setAction($action) - { - $this->action = $action; - } - - /** - * Gets the action of the form. - * - * @return string - */ - public function getAction() - { - return $this->action; - } - - /** - * Creates the CSS style attribute content for an icon for the testable with the key $testableKey. - * - * @param string $testableKey - * the key of a \Tx_Phpunit_Testable object, may also be "typo3", must not be empty - * - * @return string the content for the "style" attribute, will not be empty - * - * @throws \InvalidArgumentException - * if there is no extension with tests for the given key - */ - protected function createIconStyle($testableKey) - { - $testable = $this->testFinder->getTestableForKey($testableKey); - - return 'background: url(' . $testable->getIconPath() . ') 3px 50% white no-repeat; padding: 1px 1px 1px 24px;'; - } - - /** - * Gets all options rendered as an array. - * - * @return array[] all option parameter as a multi-dimensional array, might be empty - */ - abstract protected function getOptions(); - - /** - * Renders the select box as HTML string. - * - * @return string - */ - abstract protected function renderSelect(); -} diff --git a/Classes/ViewHelpers/AbstractTagViewHelper.php b/Classes/ViewHelpers/AbstractTagViewHelper.php deleted file mode 100644 index f62c7ac7..00000000 --- a/Classes/ViewHelpers/AbstractTagViewHelper.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ -abstract class Tx_Phpunit_ViewHelpers_AbstractTagViewHelper extends \Tx_Phpunit_ViewHelpers_AbstractViewHelper -{ - /** - * Renders any HTML tag with its own parameter either around some content. - * - * If the content is empty, the tag gets rendered as a self-closing tag. - * - * @param string $tagName - * @param string[] $attributes - * use HTML attribute as key, must not be empty - * use attribute value as array value, might be empty - * @param string $content - * - * @return string the rendered HTML tag - * - * @throws \InvalidArgumentException if the given tagName is empty - */ - protected function renderTag($tagName, array $attributes = [], $content = '') - { - if (empty($tagName)) { - throw new \InvalidArgumentException('$tagName must not be NULL or empty.', 1343763729); - } - - $output = '<' . htmlspecialchars($tagName, ENT_HTML5 | ENT_QUOTES); - - foreach ($attributes as $key => $value) { - if (!is_string($key) || $key === '') { - throw new \InvalidArgumentException('Attribute key must not be empty.', 1448657422); - } - $output .= ' ' . htmlspecialchars($key, ENT_HTML5 | ENT_QUOTES) . '="' . - htmlspecialchars($value, ENT_HTML5 | ENT_QUOTES) . '"'; - } - - if ($content !== '') { - $output .= '>' . $content . ''; - } else { - $output .= ' />'; - } - - return $output; - } -} diff --git a/Classes/ViewHelpers/AbstractViewHelper.php b/Classes/ViewHelpers/AbstractViewHelper.php deleted file mode 100644 index 2fff94bb..00000000 --- a/Classes/ViewHelpers/AbstractViewHelper.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ -abstract class Tx_Phpunit_ViewHelpers_AbstractViewHelper -{ - /** - * @var \Tx_Phpunit_Service_OutputService - */ - protected $outputService = null; - - /** - * Injects the output service. - * - * @param \Tx_Phpunit_Service_OutputService $service the service to inject - * - * @return void - */ - public function injectOutputService(\Tx_Phpunit_Service_OutputService $service) - { - $this->outputService = $service; - } - - /** - * Renders and outputs this view helper. - * - * @return void - */ - abstract public function render(); - - /** - * Returns the localized string for the key $key. - * - * @param string $key the key of the string to retrieve, must not be empty - * - * @return string the localized string for the key $key - */ - protected function translate($key) - { - return $this->getLanguageService()->getLL($key); - } - - /** - * Returns $GLOBALS['LANG']. - * - * @return LanguageService - */ - protected function getLanguageService() - { - return $GLOBALS['LANG']; - } -} diff --git a/Classes/ViewHelpers/CheckboxViewHelper.php b/Classes/ViewHelpers/CheckboxViewHelper.php deleted file mode 100644 index 0fb36a89..00000000 --- a/Classes/ViewHelpers/CheckboxViewHelper.php +++ /dev/null @@ -1,113 +0,0 @@ - - */ -class Tx_Phpunit_ViewHelpers_CheckboxViewHelper extends \Tx_Phpunit_ViewHelpers_AbstractTagViewHelper -{ - /** - * @var string - */ - protected $tagName = 'input'; - - /** - * Any additional attributes can be set here. They are resolved as key="value" in the resulting tag. - * - * Note: The keys "type" and "value" are reserved and will be overridden by the ViewHelper properties. - * - * @var string[]|int[] - */ - protected $additionalAttributes = []; - - /** - * @var string - */ - protected $type = 'checkbox'; - - /** - * According to HTML spec, an element of type "checkbox" must have a value attribute (even if it is empty). - * - * @var string - */ - protected $value = ''; - - /** - * Constructor. - * - * @param string $value - * @param string[]|int[] $additionalAttributes - */ - public function __construct($value = '', array $additionalAttributes = []) - { - $this->value = $value; - $this->additionalAttributes = $additionalAttributes; - } - - /** - * Renders the input field with the set attributes and value - * - * @return string - */ - public function render() - { - $attributes = array_merge( - $this->additionalAttributes, - [ - 'type' => $this->type, - 'value' => $this->value, - ] - ); - - return $this->renderTag( - $this->tagName, - $attributes - ); - } - - /** - * @return string[]|int[] - */ - public function getAdditionalAttributes() - { - return $this->additionalAttributes; - } - - /** - * @param string[]|int[] $additionalAttributes - */ - public function setAdditionalAttributes(array $additionalAttributes) - { - $this->additionalAttributes = $additionalAttributes; - } - - /** - * Adds the given array of additional attributes to the existing additional attributes. - * If keys are duplicated, this function will override the existing key. - * - * @param string[]|int[] $additionalAttributes - */ - public function addAdditionalAttributes(array $additionalAttributes) - { - $this->additionalAttributes = array_merge($this->additionalAttributes, $additionalAttributes); - } - - /** - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * @param string $value - */ - public function setValue($value) - { - $this->value = $value; - } -} diff --git a/Classes/ViewHelpers/ExtensionSelectorViewHelper.php b/Classes/ViewHelpers/ExtensionSelectorViewHelper.php deleted file mode 100644 index 48eea4ab..00000000 --- a/Classes/ViewHelpers/ExtensionSelectorViewHelper.php +++ /dev/null @@ -1,173 +0,0 @@ - - */ -class Tx_Phpunit_ViewHelpers_ExtensionSelectorViewHelper extends \Tx_Phpunit_ViewHelpers_AbstractSelectorViewHelper -{ - /** - * Renders the content of the view helper and pushes it to the output service. - * - * @return void - */ - public function render() - { - $content = $this->renderForm($this->renderSelect()); - - $this->outputService->output($content); - } - - /** - * Renders the form with submit button around some content. - * - * @param string $formContent - * - * @return string the final form - */ - protected function renderForm($formContent) - { - $formContentWithAdditionalElements = $formContent . - $this->renderHiddenFields() . $this->renderSubmitButton($this->translate('run_all_tests')); - - $formContentWithinParagraph = $this->renderTag('p', [], $formContentWithAdditionalElements); - - return $this->renderTag( - 'form', - [ - 'action' => $this->action, - 'method' => 'post', - ], - $formContentWithinParagraph - ); - } - - /** - * Renders some (hidden) fields for the form. - * - * @return string the rendered fields, will not be empty - */ - protected function renderHiddenFields() - { - return $this->renderTag( - 'input', - [ - 'name' => \Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE . - '[' . \Tx_Phpunit_Interface_Request::PARAMETER_KEY_COMMAND . ']', - 'type' => 'hidden', - 'value' => 'runalltests', - ] - ); - } - - /** - * Renders the submit button for the form. - * - * @param string $label the label for the button, must not be empty - * - * @return string the rendered button tag, will not be empty - */ - protected function renderSubmitButton($label) - { - return $this->renderTag( - 'button', - [ - 'accesskey' => 'a', - 'name' => \Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE . - '[' . \Tx_Phpunit_Interface_Request::PARAMETER_KEY_EXECUTE . ']', - 'type' => 'submit', - 'value' => 'run', - ], - $label - ); - } - - /** - * Renders the select box as HTML. - * - * @return string the rendered select tag - */ - protected function renderSelect() - { - $options = $this->getOptions(); - - $selectedExtensionStyle = ''; - - $renderedOptionTags = []; - foreach ($options as $option) { - if (isset($option['selected']) && $option['selected'] === 'selected') { - $selectedExtensionStyle = $option['style']; - } - if ($option['value'] === \Tx_Phpunit_Testable::ALL_EXTENSIONS) { - $optionValue = $this->translate('all_extensions'); - } else { - $optionValue = $option['value']; - } - $renderedOptionTags[] = $this->renderTag('option', $option, $optionValue); - } - - return $this->renderTag( - 'select', - [ - 'name' => \Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE . - '[' . \Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE . ']', - 'onchange' => 'document.location = \'' . $this->action . '&' . - \Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE . - '[' . \Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE . ']=' . - '\'+this.options[this.selectedIndex].value;', - 'style' => $selectedExtensionStyle, - ], - implode(LF, $renderedOptionTags) - ); - } - - /** - * Gets all options rendered as an array - * - * @return array[] all options, will not be empty - */ - protected function getOptions() - { - $options = []; - - $allExtensionOption = [ - 'class' => 'alltests', - 'value' => \Tx_Phpunit_Testable::ALL_EXTENSIONS, - ]; - if ($this->isOptionSelected(\Tx_Phpunit_Testable::ALL_EXTENSIONS)) { - $allExtensionOption['selected'] = 'selected'; - } - $options[] = $allExtensionOption; - - /** @var \Tx_Phpunit_Testable $testable */ - foreach ($this->testFinder->getTestablesForEverything() as $testable) { - $extensionOption = [ - 'style' => $this->createIconStyle($testable->getKey()), - 'value' => $testable->getKey(), - ]; - if ($this->isOptionSelected($testable->getKey())) { - $extensionOption['selected'] = 'selected'; - } - - $options[] = $extensionOption; - } - - return $options; - } - - /** - * Checks whether $option is the selected option. - * - * @param string $option the option to check, must not be empty - * - * @return bool whether $option is the selected option - */ - protected function isOptionSelected($option) - { - return $this->userSettingService->getAsString(\Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE) - === $option; - } -} diff --git a/Classes/ViewHelpers/ProgressBarViewHelper.php b/Classes/ViewHelpers/ProgressBarViewHelper.php deleted file mode 100644 index 3fffdf94..00000000 --- a/Classes/ViewHelpers/ProgressBarViewHelper.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class Tx_Phpunit_ViewHelpers_ProgressBarViewHelper extends \Tx_Phpunit_ViewHelpers_AbstractViewHelper -{ - /** - * Renders and outputs this view helper. - * - * @return void - */ - public function render() - { - $this->outputService->output( - '
' - ); - } -} diff --git a/Documentation/Introduction/WhatDoesItDo/Index.rst b/Documentation/Introduction/WhatDoesItDo/Index.rst index cd3a2307..6bcfe99d 100644 --- a/Documentation/Introduction/WhatDoesItDo/Index.rst +++ b/Documentation/Introduction/WhatDoesItDo/Index.rst @@ -27,8 +27,5 @@ PHPUnit is a TYPO3 extension which provides: #. `vfsStream `_ (a virtual file system) -#. a back-end module to run unit tests for extensions of a TYPO3 - installation - #. a CLI test runner which can be used to run the tests from the command - line, in a continuous-integration environment, or from within an IDE like PhpStorm + line or in a continuous-integration environment diff --git a/Documentation/UsersManual/Installation/Index.rst b/Documentation/UsersManual/Installation/Index.rst index 54a5e178..8cdee27a 100644 --- a/Documentation/UsersManual/Installation/Index.rst +++ b/Documentation/UsersManual/Installation/Index.rst @@ -24,39 +24,7 @@ These are basic requirements for using this extension: process and php-posix in addition to the normal list of PHP extensions. -#. Use the Extension Manager to download and install phpunit. - -#. View the extension's options in the Extension Manager and save them at - least once. - -If you would like to run the unit tests of the phpunit extension -itself, you'll also need to install the following dummy extension -which are located in EXT:phpunit/TestExtensions/: - -- aaa - -- bbb - -- ccc - -- ddd - -- user\_phpunittest - -- user\_phpunittest2 - -For running database tests, you'll also need to provide the TYPO3 -MySQL user with the following global permissions: - -- SELECT - -- INSERT - -- CREATE - -- DROP - -- ALTER +#. Use the Extension Manager or Composer to download and install phpunit. If you would like to use a different PHPUnit version, make sure you install TYPO3 and the phpunit extension via composer and specify the desired PHPUnit version in your root composer.json file. diff --git a/Resources/Private/Language/da.locallang_backend.xlf b/Resources/Private/Language/da.locallang_backend.xlf deleted file mode 100644 index e0080876..00000000 --- a/Resources/Private/Language/da.locallang_backend.xlf +++ /dev/null @@ -1,110 +0,0 @@ - - - -
- - - PHPUnit - - - TYPO3 unit tests, baseret på PHPUnit af Sebastian Bergmann - - - PHPUnit - - - Der kræves administrator-rettigheder, for at må bruge PHPUnit back-end modulet. - - - Alle extensions - - - Der blev ikke fundet extensions med unit tests. - - - Kø<span class="access-key">r</span> igen - - - Kør <span class="access-key">a</span>lle tests - - - Kør enkelt te<span class="access-key">s</span>t - - - Udfør test <span class="access-key">c</span>ase fil - - - Vælg extension - - - Vælg test - - - Tester alle extensions - - - Tester extension - - - fejl - - - mislykkedes - - - tests - - - PHPUnit BE - - - Success! - - - Mislykkedes! - - - Tests bliver udført i kontekst af Backend - - - Unit tests, bliver udført i kontekst af den aktuelle backend session. Resultated bliver derfor muligvis anderledes end hvis udført fra Commandline med test konfigurationen fra Core-Unit-Tests eller der Core-Functional-Tests. Især vil det producere mærkelige fejl med Core tests. - - - Tastatur genveje - - - Tastatur genveje - - - Tast "a" for at udføre alle tests, tast "s" for at udføre en enkelt test og tast "r" for at gen-udfører den sidste test. - - - Afhængig af dine browser og OS skal du bruge en kontrol taste samtidigt: - - - Safari og IE: tast "Alt" tasten på Windows, "Ctrl" på Macs. - - - Firefox: tast "Alt-Shift" på Windows, "Ctrl-Shift" på Macs - - - Success - - - Fejlede - - - Skippede - - - Fejl - - - Vis som læsbar - - - Ufuldførte - - - - \ No newline at end of file diff --git a/Resources/Private/Language/de.locallang_backend.xlf b/Resources/Private/Language/de.locallang_backend.xlf deleted file mode 100644 index d037b48f..00000000 --- a/Resources/Private/Language/de.locallang_backend.xlf +++ /dev/null @@ -1,119 +0,0 @@ - - - -
- - - PHPUnit - - - TYPO3 unit tests, basierend auf PHPUnit von Sebastian Bergmann - - - PHPUnit - - - Du brauchst Admin-Rechte, um das PHPUnit Back-End-Modul zu benutzen. - - - Alle Extensions - - - Es konnte keine Extension mit Unit-Tests gefunden werden - - - Test e<span class="access-key">r</span>neut ausführen - - - <span class="access-key">A</span>lle Tests ausführen - - - Einzelnen Te<span class="access-key">s</span>t ausführen - - - Alle Tests dieser Datei ausführen (<span class="access-key">c</span>) - - - Extension auswählen - - - Test auswählen - - - Teste Extensions - - - Teste Extension - - - Fehler - - - Übersprungen - - - Unvollständig - - - Probleme - - - Tests - - - Assertions - - - PHPUnit BE - - - Erfolgreich! - - - Probleme! - - - Tests werden im aktuellen Backend-Kontext ausgeführt - - - Die Unit-Tests werden im Kontext der aktuellen Backend-Session ausgeführt. Das Ergebnis wird dadurch wahrscheinlich anders sein als über die Kommandozeile mit der Testkonfiguration der Core-Unit-Tests oder der Core-Functional-Tests. Insbesondere wird dies seltsame Fehler mit den Core-Tests erzeugen. - - - Tastaturkürzel - - - Tastaturkürzel - - - Benutze "a", um alle Tests zu starten. Benutze "s", um einen Einzeltest zu starten, und benutze "r", um den letzten Test neu zu starten. - - - Abhängig von Browser und Betriebssystem müssen Tastenkombination genutzt werden: - - - Safari und IE: Verwende die "Alt"-Taste auf Windows, "Ctrl" auf Macs. - - - Firefox: Verwende "Alt-Shift" auf Windows, "Ctrl-Shift" auf Macs. - - - Erfolgreich - - - Probleme - - - Übersprungen - - - Fehler - - - Lesbare Namen verwenden - - - Unvollständig - - - - \ No newline at end of file diff --git a/Resources/Private/Language/locallang_backend.xlf b/Resources/Private/Language/locallang_backend.xlf deleted file mode 100644 index 87bce13c..00000000 --- a/Resources/Private/Language/locallang_backend.xlf +++ /dev/null @@ -1,119 +0,0 @@ - - - -
- - - PHPUnit - - - TYPO3 unit testing UI based on PHPUnit by Sebastian Bergmann - - - PHPUnit - - - You need administrator rights in order to use PHPUnit back-end module. - - - All extensions - - - Could not find any extension with unit tests. - - - <span class="access-key">R</span>e-run - - - Run <span class="access-key">a</span>ll tests - - - Run <span class="access-key">s</span>ingle test - - - Run test <span class="access-key">c</span>ase file - - - Select extension - - - Select test - - - Testing all extensions - - - Testing extension - - - errors - - - skipped - - - incomplete - - - failures - - - tests - - - assertions - - - PHPUnit BE - - - Success! - - - Failures! - - - Tests run in the current back-end context - - - The unit tests currently run in the context of the back-end session. This will produce different results than running the tests from the command line using the Core unit test or functional test configuration. Particularly, this will cause strange failures in the TYPO3 CMS Core tests. - - - Keyboard shortcuts - - - Keyboard shortcuts - - - Use "a" for running all tests, use "s" for running a single test and use "r" to re-run the latest tests. - - - Depending on your browser and system, you will need to press some modifier keys: - - - Safari and IE: Use "Alt" button on Windows, "Ctrl" on Macs. - - - Firefox: Use "Alt-Shift" on Windows, "Ctrl-Shift" on Macs. - - - Success - - - Failure - - - Skipped - - - Error - - - Show as human readable - - - Incomplete - - - - \ No newline at end of file diff --git a/Resources/Public/CSS/BackEnd.css b/Resources/Public/CSS/BackEnd.css deleted file mode 100644 index 05ac869a..00000000 --- a/Resources/Public/CSS/BackEnd.css +++ /dev/null @@ -1,177 +0,0 @@ -.testcaseOutput h3 { - font-size: 100%; - font-weight: normal; - margin: 0; - padding: 0; -} - -p { - margin-bottom: 8px; -} - -a { - color: blue; -} - -a:hover { - color: blue; - text-decoration: underline; -} - -p, div, body, input, select, textarea, .defstyle { - color: black; -} - -/* Safari hack, http://dustinbrewer.com/css-hackgetting-safari-to-behave/ */ -@media screen and (-webkit-min-device-pixel-ratio:0) { - form select { - text-indent: 18px; - } -} - -h1, h2, h3, h4 { - background-color: transparent; - color: black; - text-align: left; -} - -.access-key { - text-decoration: underline; -} - -/* Temporary bugfix for issue http://bugs.typo3.org/view.php?id=7631 */ -body#typo3-mod-php { - overflow: auto; -} - -.progress-bar-wrap { - height: 2em; - margin-bottom: 1em; - border: 1px solid black; - background-color: white; - width: 800px; -} - -#progress-bar { - border: 0; - height: 100%; - width: 0; - float: left; -} - -.alltests { - border-top: 1px solid #999999; - border-bottom: 1px solid #999999; -} - -.testcaseOutput .message { - margin: 4px; - border: 1px solid #999; - padding: 4px; - background-color: white; -} - -.testcaseOutput { - margin: 0 0 2px 0; - padding: 0; - background-color: #fff; -} - -.testcaseOutput img.runner { - border: 1px solid transparent; - vertical-align: middle; - padding: 0 2px; -} -.testcaseOutput img.runner:hover { - background: url(../Icons/RunnerRunning.gif) no-repeat 2px 0; -} - -.testcaseOutput pre.message { - white-space: normal; -} - -.testcaseOutput { - border: 1px solid #999; -} - -.testcaseOutput h3 { - padding: 2px 4px; - background-color: #afa; -} - -.testcaseFailure h3 { - background-color: #ffa; -} - -.testcaseError h3 { - background-color: #faa; -} - -.testcaseIncomplete h3 { - background-color: #d3d3d3; -} - -.testcaseSkipped h3 { - background-color: #d3d3d3; -} - -.testcaseOutput div { - padding: 0; - margin: 0; -} - -.tx_phpunit_testcase_progressbox { - background-color: aqua; - width: 100%; - height: 100%; - border: 1px solid black; - float: left; -} - -#testsHaveFinished { - display: none; -} - -/* - * Changes to general layout - */ -#doc3 { - margin: 0; - padding: 0; -} - -html { - background-color: #f8f8f8; -} - -th, td { - border: 0; -} - -h2.testSuiteName { - font-size: 13px; - font-weight: bold; -} -.wasSuccessful { - background-color: #0f0; -} -.hadFailure { - color: #000; - background-color: #ff0; -} -.hadError { - color: #000; - background-color: #f33; -} -h2.wasSuccessful, h2.hadFailure, h2.hadError { - padding: 2px 5px; - border: 1px solid #000; - width: 790px; -} - -.hide-testcaseSuccess > .testcaseSuccess, -.hide-testcaseSkipped > .testcaseSkipped, -.hide-testcaseError > .testcaseError, -.hide-testcaseFailure > .testcaseFailure{ - display: none; -} diff --git a/Resources/Public/Icons/BackEndModule.png b/Resources/Public/Icons/BackEndModule.png deleted file mode 100644 index 9b30a6c4ca8e052a4d451c4a031edc4b1ca07215..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1686 zcmV;H25I?;P)0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU&I7vi7RCwC#S^0AlWfo05@%EfMQ{Ks0v$yt$YBd*z_x%~BTy(uIa-o5 zX|Cqn?D~W#<1nS}AqG_6tBqA1*!Vz(d0ce=5tDdaJ>3{c>+W6=MDfSS8C&M;&8?uU&KU#CmEcjZx{;;6~z|z zqt!)(MD*MWo&3{>9D7~>=yfz$Yj;ND@nO>4=a2u??4)V3zE)FJp;GbGgctepGCo0) z?qKJ+z_7o{D}W`9MiBS-N$&{X!7Mw@`0-M5)T^^}WfOQ7B&pWaP1m~ILd)UYlO$CD zSW&H(CP`w@Bc$?ul-FY?Ja}m}36hK};Sj(_Bq4h5Mvfl$ghFCo0n|;`h@y1!PB`5M z_yh5ME&q{Zk+IOEuv*#mYc1P$+H-;-RVA(}SCJ&ydB&gdlM*D^>-=U*|JCkLT#z=b zE2f|$`2m2%13QJdgh^!iJdmXQl()MlgnBTuPLrn;npLlpBUdip&a% zA}(AS$_D_fmLMbqD;P|Vb1Rl6bPYMv)a-x)B8E`FHLHrIRjVO$5bT^7!Dj=Q*PzGy zp`(LojSJY;Vh(At^JmAZcg(25xQG`wf*hlj0>pUC46`O_S zc}l6wStIp~2rOG{#8cbaz3GmNQd44M=QkKGUkO%~^DozHaWNVbZ{CiqUt__T=Pw3M zclk#*0&oGz+)X!saA0z1dP+;!JH6pQPIwUx$kxFlgB@pmkJJGD5XrJ6^l=m;Fr!wB zNp#-`Wj6E=O^yxgEQ=cpP<)#9IN?NKD{y_=k9J!ziz>A7W2+dK0P<*?XH)=GPUI2m zuD>!2bR;5f*>3-2t;J$y*Q_$*3grCaK$Sjzg?+2>?Tb zws7-9S@c%Gu<84LlaZO%U_b<*UjXy??yhDhZVh_kpKr8+9@l%qZS9_%aUd>AsDpd= z4P?(VbOO!$2Cx>egMIes6Sn{?$uT8I<}v~*o)#s-WK{V5IcPzUCuq=+kR8KSo*la! zFO1`Q??pb_V1>tS+UFB+=_BO7)mthXV9dJsUlISC`d{w?dbgn5xkZ! zF_zf4>D8K@yB*mANNVcV9d?L+!)#sIOFT|$rfTYIwF3jOmLu*|TAaF?^x9F3X%!`{ zE~UIB)BU3xIoi0u0Ed^{ON7zCdq2{8!aKrF)~D->X^O;hrd|)AbV%3N=IDEFh5GuV zx!fDYM1R@uO8UIF78?r+7@L(_x4H<9?Z&O}>CPv2vJ&kmMaBd%t!jqZPpVW+u2fZ3 z@cR$BN5H^jTv)t50gH&^M~p6h3a=`Y^L$IgUc_f4et9?i@$pi6ayi zkF>%FBzCgUwSXjg0}UwAXu=U?JS+rma+MnC)N*)mSPVG>@c*5xBuUV?z(o%Qvl8;_ zJ)y?=@KL1CCyZ_chKWgzHV?o4t{;`)Y4v(+{6{u|+Q|P>$^c{lG5{HX3_u1T1CRm8 g0Av6eAO8q20NO?1S|RWSVE_OC07*qoM6N<$f+PeNxc~qF diff --git a/Resources/Public/Icons/Runner.gif b/Resources/Public/Icons/Runner.gif deleted file mode 100644 index 21d527d001cfb5132bcc31a9408ff36d3e6ed1ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 960 zcmV;x13&ynNk%w1VGaNi0Owc$000010RaL60s{jB1Ox;H1qB8M1_uWR2nYxX2?+`c z3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH8XFrM z92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021EG#T7 zEiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!-Jv}}? zK0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)WtPESuy zP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5dU|?Wj zVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&OadC2T za&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8f`fyD zgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@l$4Z} zm6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*!rKP5( zrl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dkwzs#p zxVX5vxw*Q!y1To(yu7@dCU$jHda z$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~>g((4 z?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg= z{r&#_{{R2~A^8LW3IP8AEC2ui01f~W000P`0RIUbNU&f*a{t%>fMQS}I)P9QglH&m zn5Q0fpfyw`q`(3Ib^eVj7z;rG000!QY3L1yER-mR8B~@8je!6y7-W!1&{>=(00?*z z1;T+EgF_Sm(DqN=rcVZMbO11lqQDFQ7AUx8?q9lr4_6Ub@dAL6hQk^xkn|76S%U2T it&m_!U=Jb&KgdWnu!$Xme+kxzWUyO7ADajU1OPk0aliTi diff --git a/Resources/Public/Icons/RunnerRunning.gif b/Resources/Public/Icons/RunnerRunning.gif deleted file mode 100644 index 9362b9ecf252d4b888cfbe86d61cffd8586dc3c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 839 zcmZ?wbhEHbG1`bk?>Y