From 4f354396e6a635d71aa2069d87b6623a11cef737 Mon Sep 17 00:00:00 2001 From: Riny van Tiggelen Date: Thu, 14 Nov 2024 18:00:53 +0100 Subject: [PATCH] [BUGFIX] Removed php 8.0 from github actions to prevent old phpunit requirement, fixed CrawlerControllerTest for v11 --- .github/workflows/tests.yml | 8 -------- Tests/Unit/Controller/CrawlerControllerTest.php | 10 ++++++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 92333fda..e989ea8b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,6 @@ jobs: typo3: ['11', '12', '13'] composerInstall: ['composerInstallLowest', 'composerInstallHighest'] include: - - typo3: '11' - php: '8.0' - composerInstall: 'composerInstallLowest' - - typo3: '11' - php: '8.0' - composerInstall: 'composerInstallHighest' - typo3: '11' php: '8.1' composerInstall: 'composerInstallLowest' @@ -55,9 +49,7 @@ jobs: run: Build/Scripts/runTests.sh -t ${{ matrix.typo3 }} -p ${{ matrix.php }} -s phpstan -e "--error-format=github" - name: Functional tests - if: ${{ matrix.php != '8.0' }} # Functional tests are not supported for PHP 8.0 due to PHP requirement of phpunit ^10 run: Build/Scripts/runTests.sh -t ${{ matrix.typo3 }} -p ${{ matrix.php }} -s functional - name: Unit tests - if: ${{ matrix.php != '8.0' }} # Unit tests are not supported for PHP 8.0 due to PHP requirement of phpunit ^10 run: Build/Scripts/runTests.sh -t ${{ matrix.typo3 }} -p ${{ matrix.php }} -s unit \ No newline at end of file diff --git a/Tests/Unit/Controller/CrawlerControllerTest.php b/Tests/Unit/Controller/CrawlerControllerTest.php index f2890039..a2da1ae2 100644 --- a/Tests/Unit/Controller/CrawlerControllerTest.php +++ b/Tests/Unit/Controller/CrawlerControllerTest.php @@ -9,8 +9,10 @@ use PHPUnit\Framework\Attributes\Test; use TYPO3\CMS\Core\Http\HtmlResponse; use TYPO3\CMS\Core\Http\RedirectResponse; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Site\SiteFinder; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; +use TYPO3\CMS\Extbase\Mvc\Exception\StopActionException; use TYPO3\CMS\Extbase\Mvc\Request; use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; @@ -72,8 +74,12 @@ public function indexActionReturnsHtmlResponse(): void #[Test] public function resetProgressActionReturnsRedirectResponse(): void { + if ((new Typo3Version())->getMajorVersion() === 11) { + $this->expectException(StopActionException::class); + } $result = $this->subject->resetProgressAction(1, 1); - - self::assertInstanceOf(RedirectResponse::class, $result); + if ((new Typo3Version())->getMajorVersion() > 11) { + self::assertInstanceOf(RedirectResponse::class, $result); + } } }