diff --git a/.travis.yml b/.travis.yml index b588865..6b6f3bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,51 @@ language: php -php: - - 7.2 - - 7.3 +matrix: + fast_finish: true + include: + - env: TYPO3_VERSION=^9.5 COVERAGE=1 + php: 7.2 + - env: TYPO3_VERSION=^9.5 COVERAGE=1 + php: 7.3 -sudo: true + +sudo: false + +addons: + apt: + packages: + - parallel cache: directories: - $HOME/.composer/cache +before_install: + - composer self-update + - composer --version + before_script: - - Build/Scripts/runTests.sh -s composerInstall -p $TRAVIS_PHP_VERSION + - composer require typo3/minimal=$TYPO3_VERSION + - git checkout composer.json + - export TYPO3_PATH_WEB=$PWD/.Build/Web + - mkdir -p build/logs script: - > - echo "Running composer validate" - Build/Scripts/runTests.sh -s composerValidate -p $TRAVIS_PHP_VERSION + if [[ "$COVERAGE" == "0" ]]; then + echo; + echo "Running unit tests"; + .Build/bin/phpunit --configuration phpunit.xml.dist --colors Tests/Unit/ + fi - > - echo "Running unit tests"; - Build/Scripts/runTests.sh -s unit -p $TRAVIS_PHP_VERSION + if [[ "$COVERAGE" == "1" ]]; then + echo; + echo "Running unit tests with coverage"; + .Build/bin/phpunit --configuration phpunit.xml.dist --colors --coverage-text --coverage-clover build/logs/clover.xml Tests/Unit/ + fi + +after_script: - > - echo "Running php lint"; - Build/Scripts/runTests.sh -s lint -p $TRAVIS_PHP_VERSION \ No newline at end of file + if [[ "$COVERAGE" == "1" ]]; then + travis_retry php .Build/bin/coveralls -v + fi diff --git a/Classes/Controller/Backend/StorageFrameworkManagerController.php b/Classes/Controller/Backend/StorageFrameworkManagerController.php index 1d46553..0f26469 100644 --- a/Classes/Controller/Backend/StorageFrameworkManagerController.php +++ b/Classes/Controller/Backend/StorageFrameworkManagerController.php @@ -81,6 +81,7 @@ public function session(ServerRequestInterface $request): ResponseInterface * @param ServerRequestInterface $request * @return ResponseInterface * @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException + * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidExtensionNameException */ public function core(ServerRequestInterface $request): ResponseInterface { @@ -102,6 +103,7 @@ public function core(ServerRequestInterface $request): ResponseInterface * @param ServerRequestInterface $request * @return ResponseInterface * @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException + * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidExtensionNameException */ public function extensions(ServerRequestInterface $request): ResponseInterface { @@ -118,37 +120,6 @@ public function extensions(ServerRequestInterface $request): ResponseInterface ]); } - - /** - * @param ServerRequestInterface $request - * @return ResponseInterface - * @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException - */ - public function backend(ServerRequestInterface $request): ResponseInterface - { - - $backend = GeneralUtility::makeInstance(CacheManagerService::class) - ->getSessionBackendByIdentifier('BE'); -// ->getCacheBackendByIdentifier('cache_pages'); - - try { - $backend->getBackend()->validateConfiguration(); - } catch (\Exception $e) { - var_dump($e); - } - die; - - return new JsonResponse([ - 'success' => true, - 'backend' => [ - 'identifier' => $backend->getIdentifier(), - 'type' => $backend->getType(), - 'status' => $backend->getStatus(), - 'configuration' => $backend->getConfiguration(), - ], - ]); - } - /** * @param CacheManagerService $cacheManagerService */ diff --git a/Classes/Type/Backend/Session.php b/Classes/Type/Backend/Session.php index 16d1e17..c1fe28d 100644 --- a/Classes/Type/Backend/Session.php +++ b/Classes/Type/Backend/Session.php @@ -14,7 +14,7 @@ class Session extends Enumeration /** * @return bool */ - public function isFrontent(): bool + public function isFrontend(): bool { return $this->equals(self::FE); } diff --git a/Classes/Utility/TreeUtility.php b/Classes/Utility/TreeUtility.php index 95af740..0a0352f 100644 --- a/Classes/Utility/TreeUtility.php +++ b/Classes/Utility/TreeUtility.php @@ -11,6 +11,10 @@ class TreeUtility */ public static function fromArray(array $array): string { + if (empty($array)) { + return ''; + } + $output = '