diff --git a/.github/ISSUE_TEMPLATE/support-question.md b/.github/ISSUE_TEMPLATE/support-question.md index 52c2a7b8..0c7ca33a 100644 --- a/.github/ISSUE_TEMPLATE/support-question.md +++ b/.github/ISSUE_TEMPLATE/support-question.md @@ -11,4 +11,4 @@ assignees: maechler - Have you googled your question? - Have you asked your colleagues for help? -If you could answer all this questions with yes, please feel free to open an issue with your question. We will try our best to help you. +If you could answer all these questions with yes, please feel free to open an issue with your question. We will try our best to help you. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fca3075..a90aeb71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,21 +6,20 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: env: - - { TYPO3_VERSION: 11, PHP_VERSION: 7.4 } - - { TYPO3_VERSION: 11, PHP_VERSION: 8.0 } - { TYPO3_VERSION: 12, PHP_VERSION: 8.1 } - { TYPO3_VERSION: 12, PHP_VERSION: 8.2 } - - { TYPO3_VERSION: 12, PHP_VERSION: 8.3 } + - { TYPO3_VERSION: 13, PHP_VERSION: 8.3 } + - { TYPO3_VERSION: 13, PHP_VERSION: 8.4 } env: - TCPDF_VERSION: 6.6.2 - FPDI_VERSION: 2.5.0 + TCPDF_VERSION: 6.8.2 + FPDI_VERSION: 2.6.3 steps: - name: Checkout diff --git a/.github/workflows/ter.yml b/.github/workflows/ter.yml index 92e6d0f8..623d6219 100644 --- a/.github/workflows/ter.yml +++ b/.github/workflows/ter.yml @@ -5,9 +5,7 @@ on: - "**" jobs: TERUpload: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index de703f3f..801f835a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog for TYPO3 CMS Extension pdfviewhelpers +## 3.1.0 - Not yet released + +- Adds support for TYPO3 13 LTS +- Drops support for TYPO3 11 LTS +- Drops support for PHP < 8.1 + ## 3.0.2 - February 8, 2025 - Fixes version in docs and `ext_emconf.php` diff --git a/Classes/Hooks/TypoScriptFrontendControllerHook.php b/Classes/EventListener/AfterCacheableContentIsGeneratedEventListener.php similarity index 63% rename from Classes/Hooks/TypoScriptFrontendControllerHook.php rename to Classes/EventListener/AfterCacheableContentIsGeneratedEventListener.php index 611d554f..ee65c7ed 100644 --- a/Classes/Hooks/TypoScriptFrontendControllerHook.php +++ b/Classes/EventListener/AfterCacheableContentIsGeneratedEventListener.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Bithost\Pdfviewhelpers\Hooks; +namespace Bithost\Pdfviewhelpers\EventListener; /* * * * @@ -30,26 +30,25 @@ * This copyright notice MUST APPEAR in all copies of the script! * * */ -use TYPO3\CMS\Core\SingletonInterface; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; +use Bithost\Pdfviewhelpers\Service\OutputService; +use TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent; /** - * TypoScriptFrontendController + * AfterCacheableContentIsGeneratedEventListener * * @author Markus Mächler , Esteban Gehring */ -class TypoScriptFrontendControllerHook implements SingletonInterface +class AfterCacheableContentIsGeneratedEventListener { - /** - * Prevent any output when a pdf is rendered, especially any headers being set! - */ - public function isOutputting(array &$params, TypoScriptFrontendController $ref): void + public function __construct( + protected OutputService $outputService, + ) { + } + + public function __invoke(AfterCacheableContentIsGeneratedEvent $event): void { - if ( - isset($params['pObj']->applicationData['tx_pdfviewhelpers']['pdfOutput']) - && $params['pObj']->applicationData['tx_pdfviewhelpers']['pdfOutput'] === true - ) { - $params['enableOutput'] = false; + if ($this->outputService->shouldDisablePageCache()) { + $event->disableCaching(); } } } diff --git a/Classes/Middleware/Frontend/StopOutputMiddleware.php b/Classes/Middleware/Frontend/StopOutputMiddleware.php index 2ef56643..7f2dd98c 100644 --- a/Classes/Middleware/Frontend/StopOutputMiddleware.php +++ b/Classes/Middleware/Frontend/StopOutputMiddleware.php @@ -4,24 +4,52 @@ namespace Bithost\Pdfviewhelpers\Middleware\Frontend; +/* * * + * + * This file is part of the "PDF ViewHelpers" Extension for TYPO3 CMS. + * + * (c) 2016 Markus Mächler , Bithost GmbH + * Esteban Gehring , Bithost GmbH + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + * * */ + +use Bithost\Pdfviewhelpers\Service\OutputService; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use TYPO3\CMS\Core\Http\NullResponse; -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Core\Utility\GeneralUtility; class StopOutputMiddleware implements MiddlewareInterface { + public function __construct( + protected OutputService $outputService, + ) { + } + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); - if ( - GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() >= 11 - && ($GLOBALS['TSFE']->applicationData['tx_pdfviewhelpers']['pdfOutput'] ?? false) - ) { + if ($this->outputService->isOutputDestinationOut()) { + // Avoid sending additional request header or body data if TCPDF has already sent a response return new NullResponse(); } diff --git a/Classes/Service/OutputService.php b/Classes/Service/OutputService.php new file mode 100755 index 00000000..5282e34a --- /dev/null +++ b/Classes/Service/OutputService.php @@ -0,0 +1,70 @@ +, Bithost GmbH + * Esteban Gehring , Bithost GmbH + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + * * */ + +use TYPO3\CMS\Core\SingletonInterface; + +/** + * OutputService + * + * @author Markus Mächler , Esteban Gehring + */ +class OutputService implements SingletonInterface +{ + protected bool $isOutputDestinationOut = false; + + protected bool $disableCache = true; + + public function shouldDisablePageCache(): bool + { + return $this->isOutputDestinationOut() && $this->getDisableCache(); + } + + public function isOutputDestinationOut(): bool + { + return $this->isOutputDestinationOut; + } + + public function setIsOutputDestinationOut(bool $isOutputDestinationOut): void + { + $this->isOutputDestinationOut = $isOutputDestinationOut; + } + + public function getDisableCache(): bool + { + return $this->disableCache; + } + + public function setDisableCache(bool $disableCache): void + { + $this->disableCache = $disableCache; + } +} diff --git a/Classes/ViewHelpers/DocumentViewHelper.php b/Classes/ViewHelpers/DocumentViewHelper.php index fb09b064..81a329c4 100755 --- a/Classes/ViewHelpers/DocumentViewHelper.php +++ b/Classes/ViewHelpers/DocumentViewHelper.php @@ -33,10 +33,9 @@ use Bithost\Pdfviewhelpers\Exception\Exception; use Bithost\Pdfviewhelpers\Exception\ValidationException; use Bithost\Pdfviewhelpers\Model\BasePDF; +use Bithost\Pdfviewhelpers\Service\OutputService; use setasign\Fpdi\PdfParser\PdfParserException; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; /** * DocumentViewHelper @@ -60,6 +59,13 @@ class DocumentViewHelper extends AbstractPDFViewHelper */ protected array $tcpdfReturnContentDestinations = ['S', 'E']; + protected OutputService $outputService; + + public function injectOutputService(OutputService $outputService): void + { + $this->outputService = $outputService; + } + /** * @inheritDoc */ @@ -95,8 +101,8 @@ public function initialize() $this->arguments['outputDestination'] = $this->conversionService->convertSpeakingOutputDestinationToTcpdfOutputDestination($this->arguments['outputDestination']); - if (isset($GLOBALS['TSFE']->applicationData) && in_array($this->arguments['outputDestination'], $this->tcpdfOutputContentDestinations)) { - $GLOBALS['TSFE']->applicationData['tx_pdfviewhelpers']['pdfOutput'] = true; + if (in_array($this->arguments['outputDestination'], $this->tcpdfOutputContentDestinations)) { + $this->outputService->setIsOutputDestinationOut(true); } if (!empty($this->settings['config']['class'])) { @@ -129,10 +135,7 @@ public function initialize() $this->getPDF()->setCreator($this->arguments['creator']); $this->getPDF()->disableTcpdfLink(); // Part for increasing accessibility (ua-1) - //Disables cache if set so and in frontend mode - if (isset($GLOBALS['TSFE']) && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController && $this->settings['config']['disableCache']) { - $GLOBALS['TSFE']->set_no_cache('EXT:pdfviewhelpers force disabled caching, see plugin.tx_pdfviewhelpers.settings.config.disableCache', true); - } + $this->outputService->setDisableCache($this->settings['config']['disableCache'] === '1'); $this->viewHelperVariableContainer->add('DocumentViewHelper', 'hyphenFile', $this->arguments['hyphenFile']); $this->viewHelperVariableContainer->addOrUpdate('DocumentViewHelper', 'defaultHeaderFooterScope', BasePDF::SCOPE_DOCUMENT); diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 70d728a3..91f8343a 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -6,3 +6,8 @@ services: Bithost\Pdfviewhelpers\: resource: '../Classes/*' + + Bithost\Pdfviewhelpers\EventListener\AfterCacheableContentIsGeneratedEventListener: + tags: + - name: event.listener + identifier: 'bithost/pdfviewhelpers/disable-page-cache' diff --git a/Configuration/TypoScript/Extensions/News/setup.typoscript b/Configuration/TypoScript/Extensions/News/setup.typoscript index 53c787ec..4b6a43b2 100755 --- a/Configuration/TypoScript/Extensions/News/setup.typoscript +++ b/Configuration/TypoScript/Extensions/News/setup.typoscript @@ -1,4 +1,4 @@ -[getTSFE() && getTSFE().type == 28032013] +[request && traverse(request.getQueryParams(), 'type') == 28032013] pageNewsPDF = PAGE pageNewsPDF { typeNum = 28032013 diff --git a/Documentation/ConfigurationReference/ExtNews/Index.rst b/Documentation/ConfigurationReference/ExtNews/Index.rst index 9bc99100..270c6c29 100644 --- a/Documentation/ConfigurationReference/ExtNews/Index.rst +++ b/Documentation/ConfigurationReference/ExtNews/Index.rst @@ -31,7 +31,7 @@ Please make sure that all your configuration is limited to the page type ``28032 :: - [getTSFE() && getTSFE().type == 28032013] + [request && traverse(request.getQueryParams(), 'type') == 28032013] plugin.tx_pdfviewhelpers.settings { text { types { @@ -61,7 +61,7 @@ that is located in ``EXT:yourext/Resources/Private/Templates/Extensions/News/Tem :: - [getTSFE() && getTSFE().type == 28032013] + [request && traverse(request.getQueryParams(), 'type') == 28032013] plugin.tx_news { view { templateRootPaths { diff --git a/Tests/Functional/AbstractFunctionalTestCase.php b/Tests/Functional/AbstractFunctionalTestCase.php index c406b7f9..3a949247 100644 --- a/Tests/Functional/AbstractFunctionalTestCase.php +++ b/Tests/Functional/AbstractFunctionalTestCase.php @@ -30,11 +30,19 @@ * This copyright notice MUST APPEAR in all copies of the script! * * */ +use TYPO3\CMS\Core\Information\Typo3Version; +use TYPO3\CMS\Core\View\ViewFactoryData; +use TYPO3\CMS\Core\View\ViewFactoryInterface; +use TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager; +use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; use Smalot\PdfParser\Document; use Smalot\PdfParser\Parser; use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; +use TYPO3\CMS\Core\TypoScript\AST\Node\RootNode; +use TYPO3\CMS\Core\TypoScript\FrontendTypoScript; /** * BaseFunctionalTest @@ -69,20 +77,43 @@ public function setUp(): void $this->importCSVDataSet($this->getFixtureAbsolutePath('pages.csv')); $this->setUpFrontendRootPage( 1, - array_merge($baseTypoScripts, $this->typoScriptFiles), + [ 'setup' => array_merge($baseTypoScripts, $this->typoScriptFiles)], ); + + /** @var BackendConfigurationManager $backendConfManager */ + $backendConfigurationManager = $this->get(BackendConfigurationManager::class); + $backendTypoScriptSetup = $backendConfigurationManager->getTypoScriptSetup(new InternalRequest()); + + $frontendTypoScript = new FrontendTypoScript(new RootNode(), [], [], []); + $frontendTypoScript->setSetupArray($backendTypoScriptSetup); + + $GLOBALS['TYPO3_REQUEST'] = (new InternalRequest()) + ->withPageId(1) + ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE) + ->withAttribute('frontend.typoscript', $frontendTypoScript); } protected function renderFluidTemplate(string $templatePath, array $variables = []): string { - /** @var StandaloneView $standaloneView */ - $standaloneView = GeneralUtility::makeInstance(StandaloneView::class); + if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) { + /** @var StandaloneView $view */ + $view = GeneralUtility::makeInstance(StandaloneView::class); + + $view->setFormat('html'); + $view->setTemplatePathAndFilename($templatePath); + } else { + /** @var ViewFactoryInterface $viewFactory */ + $viewFactory = GeneralUtility::makeInstance(ViewFactoryInterface::class); + $viewFactoryData = new ViewFactoryData( + templateRootPaths: [$this->getFixtureExtPath('')], + templatePathAndFilename: $templatePath, + ); + $view = $viewFactory->create($viewFactoryData); + } - $standaloneView->setFormat('html'); - $standaloneView->setTemplatePathAndFilename($templatePath); - $standaloneView->assignMultiple($variables); + $view->assignMultiple($variables); - return (string) $standaloneView->render(); + return $view->render(); } protected function getFixtureExtPath(string $path): string diff --git a/Tests/Functional/Examples/BasicUsageTest.php b/Tests/Functional/Examples/BasicUsageTest.php index 141819ab..4e30713d 100644 --- a/Tests/Functional/Examples/BasicUsageTest.php +++ b/Tests/Functional/Examples/BasicUsageTest.php @@ -32,6 +32,7 @@ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; use TYPO3\CMS\Core\Utility\GeneralUtility; +use PHPUnit\Framework\Attributes\Test; /** * ExamplesTest @@ -44,9 +45,7 @@ class BasicUsageTest extends AbstractFunctionalTestCase 'EXT:pdfviewhelpers/Tests/Functional/Fixtures/Examples/BasicUsage.typoscript', ]; - /** - * @test - */ + #[Test] public function testBasicUsage(): void { $outputPath = GeneralUtility::getFileAbsFileName('EXT:pdfviewhelpers/Tests/Output/BasicUsage.pdf'); diff --git a/Tests/Functional/Examples/ExtendExistingPDFsTest.php b/Tests/Functional/Examples/ExtendExistingPDFsTest.php index da12c07b..59aa24fc 100644 --- a/Tests/Functional/Examples/ExtendExistingPDFsTest.php +++ b/Tests/Functional/Examples/ExtendExistingPDFsTest.php @@ -32,6 +32,7 @@ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; use TYPO3\CMS\Core\Utility\GeneralUtility; +use PHPUnit\Framework\Attributes\Test; /** * ExtendExistingPDFsTest @@ -44,9 +45,7 @@ class ExtendExistingPDFsTest extends AbstractFunctionalTestCase 'EXT:pdfviewhelpers/Tests/Functional/Fixtures/Examples/ExtendExistingPDFs.typoscript', ]; - /** - * @test - */ + #[Test] public function testExtendExistingPDFs(): void { $outputPath = GeneralUtility::getFileAbsFileName('EXT:pdfviewhelpers/Tests/Output/ExtendExistingPDFs.pdf'); diff --git a/Tests/Functional/Examples/FullFeatureShowCaseTest.php b/Tests/Functional/Examples/FullFeatureShowCaseTest.php index f70a6233..6b10cc8b 100644 --- a/Tests/Functional/Examples/FullFeatureShowCaseTest.php +++ b/Tests/Functional/Examples/FullFeatureShowCaseTest.php @@ -32,6 +32,7 @@ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; use TYPO3\CMS\Core\Utility\GeneralUtility; +use PHPUnit\Framework\Attributes\Test; /** * FullFeatureShowCaseTest @@ -44,9 +45,7 @@ class FullFeatureShowCaseTest extends AbstractFunctionalTestCase 'EXT:pdfviewhelpers/Tests/Functional/Fixtures/Examples/FullFeatureShowCase.typoscript', ]; - /** - * @test - */ + #[Test] public function testFullFeatureShowCase(): void { $outputPath = GeneralUtility::getFileAbsFileName('EXT:pdfviewhelpers/Tests/Output/FullFeatureShowCase.pdf'); diff --git a/Tests/Functional/Examples/PDFATest.php b/Tests/Functional/Examples/PDFATest.php index 9248b34c..0306890b 100644 --- a/Tests/Functional/Examples/PDFATest.php +++ b/Tests/Functional/Examples/PDFATest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * PDFATest @@ -43,9 +44,7 @@ class PDFATest extends AbstractFunctionalTestCase 'EXT:pdfviewhelpers/Tests/Functional/Fixtures/Examples/PDFA.typoscript', ]; - /** - * @test - */ + #[Test] public function testPDFA(): void { $output = $this->renderFluidTemplate($this->getFixtureExtPath('Examples/PDFA.html')); diff --git a/Tests/Functional/Examples/TableOfContentTest.php b/Tests/Functional/Examples/TableOfContentTest.php index d92eeba9..645f5257 100644 --- a/Tests/Functional/Examples/TableOfContentTest.php +++ b/Tests/Functional/Examples/TableOfContentTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * TableOfContentTest @@ -43,9 +44,7 @@ class TableOfContentTest extends AbstractFunctionalTestCase 'EXT:pdfviewhelpers/Tests/Functional/Fixtures/Examples/TableOfContent.typoscript', ]; - /** - * @test - */ + #[Test] public function testTableOfContent(): void { $output = $this->renderFluidTemplate($this->getFixtureExtPath('Examples/TableOfContent.html')); diff --git a/Tests/Functional/ExtendExistingPDFsTest.php b/Tests/Functional/ExtendExistingPDFsTest.php index 00ed6410..cd3b8137 100644 --- a/Tests/Functional/ExtendExistingPDFsTest.php +++ b/Tests/Functional/ExtendExistingPDFsTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Exception\Exception; +use PHPUnit\Framework\Attributes\Test; /** * ExtendExistingPDFsTest @@ -39,9 +40,7 @@ */ class ExtendExistingPDFsTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testDoImportOnAutomaticPageBreak(): void { $output = $this->renderFluidTemplate( @@ -68,9 +67,7 @@ public function testDoImportOnAutomaticPageBreak(): void $this->assertStringContainsStringIgnoringCase('Lorem ipsum dolor sit amet', $pages[1]->getText()); } - /** - * @test - */ + #[Test] public function testDoNotImportOnAutomaticPageBreak(): void { $output = $this->renderFluidTemplate( @@ -97,9 +94,7 @@ public function testDoNotImportOnAutomaticPageBreak(): void $this->assertStringContainsStringIgnoringCase('Lorem ipsum dolor sit amet', $pages[1]->getText()); } - /** - * @test - */ + #[Test] public function testImportWrongPage(): void { $this->expectException(Exception::class); diff --git a/Tests/Functional/Fixtures/Examples/BasicUsage.pdf b/Tests/Functional/Fixtures/Examples/BasicUsage.pdf index f0ec13a8..2145a89c 100644 Binary files a/Tests/Functional/Fixtures/Examples/BasicUsage.pdf and b/Tests/Functional/Fixtures/Examples/BasicUsage.pdf differ diff --git a/Tests/Functional/Fixtures/Examples/ExtendExistingPDFs.pdf b/Tests/Functional/Fixtures/Examples/ExtendExistingPDFs.pdf index 433ac5af..57771665 100644 Binary files a/Tests/Functional/Fixtures/Examples/ExtendExistingPDFs.pdf and b/Tests/Functional/Fixtures/Examples/ExtendExistingPDFs.pdf differ diff --git a/Tests/Functional/Fixtures/Examples/FullFeatureShowCase.pdf b/Tests/Functional/Fixtures/Examples/FullFeatureShowCase.pdf index 0b8d1719..a86b0993 100644 Binary files a/Tests/Functional/Fixtures/Examples/FullFeatureShowCase.pdf and b/Tests/Functional/Fixtures/Examples/FullFeatureShowCase.pdf differ diff --git a/Tests/Functional/Fixtures/pages.csv b/Tests/Functional/Fixtures/pages.csv index de9c3635..637eb1ed 100755 --- a/Tests/Functional/Fixtures/pages.csv +++ b/Tests/Functional/Fixtures/pages.csv @@ -1,3 +1,3 @@ -pages,,,,,, -,uid,pid,title,deleted,is_siteroot -,1,0,"Root",0,1 +pages,,,,,,, +,uid,pid,title,deleted,is_siteroot,slug +,1,0,"Root",0,1,"/" diff --git a/Tests/Functional/SpeakingSettingsInSetupTest.php b/Tests/Functional/SpeakingSettingsInSetupTest.php index 103e3818..3c70d747 100644 --- a/Tests/Functional/SpeakingSettingsInSetupTest.php +++ b/Tests/Functional/SpeakingSettingsInSetupTest.php @@ -30,6 +30,8 @@ * This copyright notice MUST APPEAR in all copies of the script! * * */ +use PHPUnit\Framework\Attributes\Test; + /** * SpeakingSettingsInSetupTest * @@ -41,9 +43,7 @@ class SpeakingSettingsInSetupTest extends AbstractFunctionalTestCase 'EXT:pdfviewhelpers/Tests/Functional/Fixtures/SpeakingSettings/setup_speaking.typoscript', ]; - /** - * @test - */ + #[Test] public function testSpeakingSetupSettings() { $this->markTestSkipped('Changing settings in TS not working because of AbstractViewHelper::$argumentDefinitionCache.'); diff --git a/Tests/Functional/SpeakingSettingsTest.php b/Tests/Functional/SpeakingSettingsTest.php index a2cfab2b..fa21db9c 100644 --- a/Tests/Functional/SpeakingSettingsTest.php +++ b/Tests/Functional/SpeakingSettingsTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Exception\ValidationException; +use PHPUnit\Framework\Attributes\Test; /** * SpeakingSettingsTest @@ -43,9 +44,7 @@ class SpeakingSettingsTest extends AbstractFunctionalTestCase 'EXT:pdfviewhelpers/Tests/Functional/Fixtures/SpeakingSettings/setup.typoscript', ]; - /** - * @test - */ + #[Test] public function testSetupSettings(): void { $this->markTestSkipped('Changing settings in TS not working because of AbstractViewHelper::$argumentDefinitionCache.'); @@ -57,9 +56,7 @@ public function testSetupSettings(): void $this->assertStringContainsStringIgnoringCase('Test', $text); } - /** - * @test - */ + #[Test] public function testFluid(): void { $outputDestinations = ['string', 'S']; @@ -91,9 +88,7 @@ public function testFluid(): void } } - /** - * @test - */ + #[Test] public function testInvalidOutputDestination(): void { $this->expectException(ValidationException::class); @@ -109,9 +104,7 @@ public function testInvalidOutputDestination(): void ); } - /** - * @test - */ + #[Test] public function testInvalidOrientation(): void { $this->expectException(ValidationException::class); @@ -127,9 +120,7 @@ public function testInvalidOrientation(): void ); } - /** - * @test - */ + #[Test] public function testInvalidFontStyle(): void { $this->expectException(ValidationException::class); @@ -145,9 +136,7 @@ public function testInvalidFontStyle(): void ); } - /** - * @test - */ + #[Test] public function testInvalidAlignment(): void { $this->expectException(ValidationException::class); diff --git a/Tests/Functional/ViewHelpers/AvoidPageBreakInsideCustomFontViewHelperTest.php b/Tests/Functional/ViewHelpers/AvoidPageBreakInsideCustomFontViewHelperTest.php index 4a8c1353..30448385 100644 --- a/Tests/Functional/ViewHelpers/AvoidPageBreakInsideCustomFontViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/AvoidPageBreakInsideCustomFontViewHelperTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * AvoidPageBreakInsideCustomFontViewHelperTest @@ -43,9 +44,7 @@ class AvoidPageBreakInsideCustomFontViewHelperTest extends AbstractFunctionalTes 'EXT:pdfviewhelpers/Tests/Functional/Fixtures/AvoidPageBreakInsideViewHelper/CustomFont.typoscript', ]; - /** - * @test - */ + #[Test] public function testCustomFont(): void { $output = $this->renderFluidTemplate( diff --git a/Tests/Functional/ViewHelpers/AvoidPageBreakInsideViewHelperTest.php b/Tests/Functional/ViewHelpers/AvoidPageBreakInsideViewHelperTest.php index 84a8eeea..fc9adb09 100644 --- a/Tests/Functional/ViewHelpers/AvoidPageBreakInsideViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/AvoidPageBreakInsideViewHelperTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * AvoidPageBreakInsideViewHelperTest @@ -39,9 +40,7 @@ */ class AvoidPageBreakInsideViewHelperTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testPageBreakPossible1(): void { $output = $this->renderFluidTemplate( @@ -61,9 +60,7 @@ public function testPageBreakPossible1(): void $this->assertStringContainsStringIgnoringCase('text2', $pages[1]->getText()); } - /** - * @test - */ + #[Test] public function testPageBreakPossible2(): void { $output = $this->renderFluidTemplate( @@ -83,9 +80,7 @@ public function testPageBreakPossible2(): void $this->assertStringContainsStringIgnoringCase('text2', $pages[1]->getText()); } - /** - * @test - */ + #[Test] public function testImpossibleToAvoid1(): void { $output = $this->renderFluidTemplate( @@ -105,9 +100,7 @@ public function testImpossibleToAvoid1(): void $this->assertStringContainsStringIgnoringCase('text2', $pages[0]->getText()); } - /** - * @test - */ + #[Test] public function testImpossibleToAvoid2(): void { $output = $this->renderFluidTemplate( diff --git a/Tests/Functional/ViewHelpers/DocumentViewHelperTest.php b/Tests/Functional/ViewHelpers/DocumentViewHelperTest.php index 09387429..80394b93 100644 --- a/Tests/Functional/ViewHelpers/DocumentViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/DocumentViewHelperTest.php @@ -32,6 +32,7 @@ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; use TYPO3\CMS\Core\Utility\GeneralUtility; +use PHPUnit\Framework\Attributes\Test; /** * DocumentViewHelperTest @@ -40,9 +41,7 @@ */ class DocumentViewHelperTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testMetaInformation(): void { $output = $this->renderFluidTemplate($this->getFixtureExtPath('DocumentViewHelper/MetaInformation.html')); @@ -52,9 +51,7 @@ public function testMetaInformation(): void $this->assertEquals('TYPO3 EXT:pdfviewhelpers', $details['Creator']); } - /** - * @test - */ + #[Test] public function testMetaInformationOverwrite(): void { $output = $this->renderFluidTemplate( @@ -67,9 +64,7 @@ public function testMetaInformationOverwrite(): void $this->assertEquals('Some other creator', $details['Creator']); } - /** - * @test - */ + #[Test] public function testOutputDestinationF(): void { $output = $this->renderFluidTemplate( @@ -84,9 +79,7 @@ public function testOutputDestinationF(): void $this->assertGreaterThan(5000, filesize($savePath)); } - /** - * @test - */ + #[Test] public function testOutputDestinationS(): void { $output = $this->renderFluidTemplate( @@ -97,9 +90,7 @@ public function testOutputDestinationS(): void $this->assertNotEmpty(trim($output)); } - /** - * @test - */ + #[Test] public function testOutputDestinationE(): void { $output = $this->renderFluidTemplate( diff --git a/Tests/Functional/ViewHelpers/HeaderAndFooterViewHelperTest.php b/Tests/Functional/ViewHelpers/HeaderAndFooterViewHelperTest.php index 23d4b9ea..f3badee6 100644 --- a/Tests/Functional/ViewHelpers/HeaderAndFooterViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/HeaderAndFooterViewHelperTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * PageViewHelperTest @@ -39,9 +40,7 @@ */ class HeaderAndFooterViewHelperTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testDocumentScope(): void { $output = $this->renderFluidTemplate( @@ -56,9 +55,7 @@ public function testDocumentScope(): void $this->assertEquals(1, mb_substr_count($text, 'Footer')); } - /** - * @test - */ + #[Test] public function testDocumentScopeWithAutoPageBreak(): void { $output = $this->renderFluidTemplate( @@ -73,9 +70,7 @@ public function testDocumentScopeWithAutoPageBreak(): void $this->assertEquals(2, mb_substr_count($text, 'Footer')); } - /** - * @test - */ + #[Test] public function testDocumentScopeEmpty(): void { $output = $this->renderFluidTemplate($this->getFixtureExtPath('HeaderAndFooterViewHelper/DocumentScopeEmpty.html')); @@ -87,9 +82,7 @@ public function testDocumentScopeEmpty(): void $this->assertEquals(1, mb_substr_count($text, 'Footer')); } - /** - * @test - */ + #[Test] public function testPageScope(): void { $output = $this->renderFluidTemplate( @@ -104,9 +97,7 @@ public function testPageScope(): void $this->assertEquals(1, mb_substr_count($text, 'Footer')); } - /** - * @test - */ + #[Test] public function testPageScopeEmpty(): void { $output = $this->renderFluidTemplate($this->getFixtureExtPath('HeaderAndFooterViewHelper/PageScopeEmpty.html')); @@ -118,9 +109,7 @@ public function testPageScopeEmpty(): void $this->assertEquals(1, mb_substr_count($text, 'Footer')); } - /** - * @test - */ + #[Test] public function testPageScopeWithAutoPageBreak(): void { $output = $this->renderFluidTemplate( @@ -135,9 +124,7 @@ public function testPageScopeWithAutoPageBreak(): void $this->assertEquals(2, mb_substr_count($text, 'Footer')); } - /** - * @test - */ + #[Test] public function testDocumentAndPageScope(): void { $output = $this->renderFluidTemplate( diff --git a/Tests/Functional/ViewHelpers/HtmlViewHelperTest.php b/Tests/Functional/ViewHelpers/HtmlViewHelperTest.php index 498e275b..649701f1 100644 --- a/Tests/Functional/ViewHelpers/HtmlViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/HtmlViewHelperTest.php @@ -32,6 +32,7 @@ use Bithost\Pdfviewhelpers\Exception\ValidationException; use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * HtmlViewHelperTest @@ -40,9 +41,7 @@ */ class HtmlViewHelperTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testRenderRichText(): void { $html = '

Headline

Text

'; @@ -60,9 +59,7 @@ public function testRenderRichText(): void $this->assertStringNotContainsStringIgnoringCase('

', $pdf->getText()); } - /** - * @test - */ + #[Test] public function testInvalidStylesheet(): void { $this->expectException(ValidationException::class); diff --git a/Tests/Functional/ViewHelpers/ImageViewHelperTest.php b/Tests/Functional/ViewHelpers/ImageViewHelperTest.php index 0ff6b881..d4040c59 100644 --- a/Tests/Functional/ViewHelpers/ImageViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/ImageViewHelperTest.php @@ -33,6 +33,7 @@ use Bithost\Pdfviewhelpers\Exception\ValidationException; use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; use TYPO3\CMS\Core\Resource\FileInterface; +use PHPUnit\Framework\Attributes\Test; /** * ImageViewHelperTest @@ -41,9 +42,7 @@ */ class ImageViewHelperTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testStringSource(): void { $output = $this->renderFluidTemplate( @@ -57,9 +56,7 @@ public function testStringSource(): void $this->assertCount(1, $images); } - /** - * @test - */ + #[Test] public function testFileSource(): void { $fileInterfaceMock = $this->createMock(FileInterface::class); @@ -77,9 +74,7 @@ public function testFileSource(): void $this->assertCount(1, $images); } - /** - * @test - */ + #[Test] public function testInvalidStringSource(): void { $this->expectException(ValidationException::class); diff --git a/Tests/Functional/ViewHelpers/ListViewHelperTest.php b/Tests/Functional/ViewHelpers/ListViewHelperTest.php index 9c0c1d52..430f7d54 100644 --- a/Tests/Functional/ViewHelpers/ListViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/ListViewHelperTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * ListViewHelperTest @@ -39,9 +40,7 @@ */ class ListViewHelperTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testListRendered(): void { $listElements = ['lorem', 'ipsum', 'dolor']; diff --git a/Tests/Functional/ViewHelpers/MultiColumnViewHelperTest.php b/Tests/Functional/ViewHelpers/MultiColumnViewHelperTest.php index b8daf07c..ef4a3c80 100644 --- a/Tests/Functional/ViewHelpers/MultiColumnViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/MultiColumnViewHelperTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * MultiColumnViewHelperTest @@ -39,9 +40,7 @@ */ class MultiColumnViewHelperTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testMultipleColumnsRendered(): void { $output = $this->renderFluidTemplate($this->getFixtureExtPath('MultiColumnViewHelper/MultiColumn.html')); diff --git a/Tests/Functional/ViewHelpers/PageBreakViewHelperTest.php b/Tests/Functional/ViewHelpers/PageBreakViewHelperTest.php index 6a2ece8c..1a6f9aa3 100644 --- a/Tests/Functional/ViewHelpers/PageBreakViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/PageBreakViewHelperTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * PageBreakViewHelperTest @@ -39,9 +40,7 @@ */ class PageBreakViewHelperTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testForcePageBreak(): void { $output = $this->renderFluidTemplate($this->getFixtureExtPath('PageBreakViewHelper/Pages.html')); diff --git a/Tests/Functional/ViewHelpers/PageViewHelperTest.php b/Tests/Functional/ViewHelpers/PageViewHelperTest.php index ebeb9c43..530e455d 100644 --- a/Tests/Functional/ViewHelpers/PageViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/PageViewHelperTest.php @@ -31,6 +31,7 @@ * * */ use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * PageViewHelperTest @@ -39,9 +40,7 @@ */ class PageViewHelperTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function testAddPages(): void { $output = $this->renderFluidTemplate($this->getFixtureExtPath('PageViewHelper/AddPages.html')); @@ -60,9 +59,7 @@ public function testAddPages(): void $this->assertStringNotContainsStringIgnoringCase('Page 2', $pages[2]->getText()); } - /** - * @test - */ + #[Test] public function testAutoPageBreakOn(): void { $longLoremIpsumText = $this->getLongLoremIpsumText(10); @@ -75,9 +72,7 @@ public function testAutoPageBreakOn(): void $this->assertEquals(2, count($pdf->getPages())); } - /** - * @test - */ + #[Test] public function testAutoPageBreakOff(): void { $longLoremIpsumText = $this->getLongLoremIpsumText(10); diff --git a/Tests/Functional/ViewHelpers/TextViewHelperTest.php b/Tests/Functional/ViewHelpers/TextViewHelperTest.php index 62325b62..a8284cd4 100644 --- a/Tests/Functional/ViewHelpers/TextViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/TextViewHelperTest.php @@ -32,6 +32,7 @@ use Bithost\Pdfviewhelpers\Exception\ValidationException; use Bithost\Pdfviewhelpers\Tests\Functional\AbstractFunctionalTestCase; +use PHPUnit\Framework\Attributes\Test; /** * TextViewHelperTest @@ -45,9 +46,7 @@ class TextViewHelperTest extends AbstractFunctionalTestCase */ protected $untrimmedText = "\n\n\t\t Some text containing double whitespaces \t\n\t\n"; - /** - * @test - */ + #[Test] public function testTrimAndRemoveDoubleWhitespace(): void { $output = $this->renderFluidTemplate( @@ -59,9 +58,7 @@ public function testTrimAndRemoveDoubleWhitespace(): void $this->assertStringContainsStringIgnoringCase('Some text containing double whitespaces', $pdf->getText()); } - /** - * @test - */ + #[Test] public function testNotRemoveDoubleWhitespace(): void { $output = $this->renderFluidTemplate( @@ -73,9 +70,7 @@ public function testNotRemoveDoubleWhitespace(): void $this->assertStringContainsStringIgnoringCase(trim($this->untrimmedText), $pdf->getText()); } - /** - * @test - */ + #[Test] public function testColorShort(): void { $output = $this->renderFluidTemplate( @@ -87,9 +82,7 @@ public function testColorShort(): void $this->assertStringContainsStringIgnoringCase('Text', $pdf->getText()); } - /** - * @test - */ + #[Test] public function testColorLong(): void { $output = $this->renderFluidTemplate( @@ -101,9 +94,7 @@ public function testColorLong(): void $this->assertStringContainsStringIgnoringCase('Text', $pdf->getText()); } - /** - * @test - */ + #[Test] public function testInvalidColor(): void { $this->expectException(\Bithost\Pdfviewhelpers\Exception\ValidationException::class); @@ -114,9 +105,7 @@ public function testInvalidColor(): void ); } - /** - * @test - */ + #[Test] public function testPartialPaddingOverwrite(): void { $output = $this->renderFluidTemplate( @@ -128,9 +117,7 @@ public function testPartialPaddingOverwrite(): void $this->assertStringContainsStringIgnoringCase('Text', $pdf->getText()); } - /** - * @test - */ + #[Test] public function testInvalidPAddingKey(): void { $this->expectException(ValidationException::class); @@ -141,9 +128,7 @@ public function testInvalidPAddingKey(): void ); } - /** - * @test - */ + #[Test] public function testInvalidPAdding(): void { $this->expectException(ValidationException::class); diff --git a/Tests/Unit/Service/SettingsConversionServiceTest.php b/Tests/Unit/Service/SettingsConversionServiceTest.php index b9cc6984..e46497ce 100644 --- a/Tests/Unit/Service/SettingsConversionServiceTest.php +++ b/Tests/Unit/Service/SettingsConversionServiceTest.php @@ -33,6 +33,7 @@ use Bithost\Pdfviewhelpers\Exception\ValidationException; use Bithost\Pdfviewhelpers\Service\ConversionService; use Bithost\Pdfviewhelpers\Tests\Unit\AbstractUnitTestCase; +use PHPUnit\Framework\Attributes\Test; /** * SettingsConversionServiceTest @@ -45,12 +46,12 @@ class SettingsConversionServiceTest extends AbstractUnitTestCase protected function setUp(): void { + parent::setUp(); + $this->settingsConversionService = new ConversionService(); } - /** - * @test - */ + #[Test] public function testHexToRGB(): void { $hexShort = '#05B'; @@ -60,9 +61,7 @@ public function testHexToRGB(): void $this->assertEquals(['R' => 18, 'G' => 171, 'B' => 205], $this->settingsConversionService->convertHexToRGB($hexLong)); } - /** - * @test - */ + #[Test] public function testOrientation(): void { $expectedConversions = [ @@ -77,9 +76,7 @@ public function testOrientation(): void } } - /** - * @test - */ + #[Test] public function testInvalidOrientation(): void { $this->expectException(ValidationException::class); @@ -87,9 +84,7 @@ public function testInvalidOrientation(): void $this->settingsConversionService->convertSpeakingOrientationToTcpdfOrientation('foobar'); } - /** - * @test - */ + #[Test] public function testOutputDestination(): void { $expectedConversions = [ @@ -114,9 +109,7 @@ public function testOutputDestination(): void } } - /** - * @test - */ + #[Test] public function testInvalidOutputDestination(): void { $this->expectException(ValidationException::class); @@ -124,9 +117,7 @@ public function testInvalidOutputDestination(): void $this->settingsConversionService->convertSpeakingOutputDestinationToTcpdfOutputDestination('foobar'); } - /** - * @test - */ + #[Test] public function testFontStyle(): void { $expectedConversions = [ @@ -145,9 +136,7 @@ public function testFontStyle(): void } } - /** - * @test - */ + #[Test] public function testInvalidFontStyle(): void { $this->expectException(ValidationException::class); @@ -155,9 +144,7 @@ public function testInvalidFontStyle(): void $this->settingsConversionService->convertSpeakingFontStyleToTcpdfFontStyle('foobar'); } - /** - * @test - */ + #[Test] public function testAlignment(): void { $expectedConversions = [ @@ -176,9 +163,7 @@ public function testAlignment(): void } } - /** - * @test - */ + #[Test] public function testInvalidAlignment(): void { $this->expectException(ValidationException::class); @@ -186,9 +171,7 @@ public function testInvalidAlignment(): void $this->settingsConversionService->convertSpeakingAlignmentToTcpdfAlignment('foobar'); } - /** - * @test - */ + #[Test] public function testImageTypes(): void { $settings = [ diff --git a/Tests/Unit/Service/ValidationServiceTest.php b/Tests/Unit/Service/ValidationServiceTest.php index 59e21438..6e17d637 100644 --- a/Tests/Unit/Service/ValidationServiceTest.php +++ b/Tests/Unit/Service/ValidationServiceTest.php @@ -34,6 +34,7 @@ use Bithost\Pdfviewhelpers\Exception\ValidationException; use Bithost\Pdfviewhelpers\Service\ValidationService; use Bithost\Pdfviewhelpers\Tests\Unit\AbstractUnitTestCase; +use PHPUnit\Framework\Attributes\Test; /** * ValidationServiceTest @@ -46,12 +47,12 @@ class ValidationServiceTest extends AbstractUnitTestCase protected function setUp(): void { + parent::setUp(); + $this->validationService = new ValidationService(); } - /** - * @test - */ + #[Test] public function testValidPadding(): void { $padding = ['top' => 10, 'right' => 0, 'bottom' => 20, 'left' => 10]; @@ -59,9 +60,7 @@ public function testValidPadding(): void $this->assertTrue($this->validationService->validatePadding($padding)); } - /** - * @test - */ + #[Test] public function testInvalidPaddingMissingAttribute(): void { $padding = ['top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0]; @@ -80,9 +79,7 @@ public function testInvalidPaddingMissingAttribute(): void } } - /** - * @test - */ + #[Test] public function testInvalidPaddingNonNumeric(): void { $padding = ['top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0]; @@ -101,9 +98,7 @@ public function testInvalidPaddingNonNumeric(): void } } - /** - * @test - */ + #[Test] public function testInvalidPaddingTooManyElements(): void { $padding = ['top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0, 'bla' => 0]; @@ -112,9 +107,7 @@ public function testInvalidPaddingTooManyElements(): void $this->validationService->validatePadding($padding); } - /** - * @test - */ + #[Test] public function testColor(): void { $colorShort = '#1B3'; @@ -124,9 +117,7 @@ public function testColor(): void $this->assertTrue($this->validationService->validateColor($colorLong)); } - /** - * @test - */ + #[Test] public function testInvalidColor(): void { $invalidColors = ['#1Y3', '#8ABC99B', '123', '#12']; @@ -141,9 +132,7 @@ public function testInvalidColor(): void } } - /** - * @test - */ + #[Test] public function testWidth(): void { $validWidths = ['10', '0', '1', '100.5']; @@ -153,9 +142,7 @@ public function testWidth(): void } } - /** - * @test - */ + #[Test] public function testInvalidWidth(): void { $invalidWidths = ['-1', '-0.1', 'a10', '10b', 'abc', '']; @@ -170,9 +157,7 @@ public function testInvalidWidth(): void } } - /** - * @test - */ + #[Test] public function testFontSize(): void { $validFontSizes = ['10', '0', '1', '100.5']; @@ -182,9 +167,7 @@ public function testFontSize(): void } } - /** - * @test - */ + #[Test] public function testInvalidFontSize(): void { $invalidFontSizes = ['-1', '-0.1', 'a10', '10b', 'abc', '']; @@ -199,9 +182,7 @@ public function testInvalidFontSize(): void } } - /** - * @test - */ + #[Test] public function testFontFamily(): void { $fontFamilies = ['robotob', 'courieri', 'timesb']; @@ -211,9 +192,7 @@ public function testFontFamily(): void } } - /** - * @test - */ + #[Test] public function testInvalidFontFamily(): void { $invalidFontFamilies = ['robotobold', 'courieritalic', 'times-b', '']; @@ -228,9 +207,7 @@ public function testInvalidFontFamily(): void } } - /** - * @test - */ + #[Test] public function testParaghraphSpacing(): void { $validParagraphSpacing = ['10', '0', '1', '100.5']; @@ -240,9 +217,7 @@ public function testParaghraphSpacing(): void } } - /** - * @test - */ + #[Test] public function testInvalidParaghraphSpacing(): void { $invalidParagraphSpacing = ['-1', '-0.1', 'a10', '10b', 'abc', '']; @@ -257,9 +232,7 @@ public function testInvalidParaghraphSpacing(): void } } - /** - * @test - */ + #[Test] public function testHeight(): void { $validHeight = ['10', '0', '1', '100.5']; @@ -269,9 +242,7 @@ public function testHeight(): void } } - /** - * @test - */ + #[Test] public function testInvalidHeight(): void { $invalidHeight = ['-1', '-0.1', 'a10', '10b', 'abc', '']; diff --git a/composer.json b/composer.json index e2d998bc..0a25e6c0 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,14 @@ } ], "require": { - "typo3/cms-core": "^11.5 || ^12.4", - "php": ">=7.4.0", + "typo3/cms-core": "^12.4 || ^13.4", + "php": ">=8.1.0", "tecnickcom/tcpdf": "^6.2", "setasign/fpdi": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^9", - "typo3/testing-framework": "^7.0@dev", + "phpunit/phpunit": "^10", + "typo3/testing-framework": "^8.0@dev", "smalot/pdfparser": "^2", "squizlabs/php_codesniffer": "^3.7", "sbuerk/typo3-cmscomposerinstallers-testingframework-bridge": "^0.1.2" diff --git a/ext_emconf.php b/ext_emconf.php index 3a38ba0d..da12d972 100755 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -15,7 +15,7 @@ 'version' => '3.0.2', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-12.4.99', + 'typo3' => '12.4.0-13.4.99', 'php' => '7.4.0-0.0.0', ], 'conflicts' => [], diff --git a/ext_localconf.php b/ext_localconf.php deleted file mode 100644 index 7dbdb852..00000000 --- a/ext_localconf.php +++ /dev/null @@ -1,3 +0,0 @@ -isOutputting';