Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2e55ab8

Browse files
committedJan 17, 2022
Switch to Github workflows
1 parent b78bccb commit 2e55ab8

13 files changed

+249
-193
lines changed
 

‎.github/FUNDING.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
custom: ["https://www.paypal.me/helhum/19.99"]
2+
github: helhum

‎.github/workflows/Deploy.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- "v?[0-9]+.[0-9]+.[0-9]+"
7+
8+
jobs:
9+
Ship-to-TER:
10+
name: 'Ship to TER'
11+
if: github.repository == 'helhum/typoscript_rendering'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Composer Cache Vars
18+
id: composer-cache-vars
19+
run: |
20+
echo "::set-output name=dir::$(composer config cache-files-dir)"
21+
echo "::set-output name=timestamp::$(date +"%s")"
22+
23+
- name: Cache Composer dependencies
24+
uses: actions/cache@v2
25+
with:
26+
path: ${{ steps.composer-cache-vars.outputs.dir }}
27+
key: ${{ runner.os }}-composer-^11.5.5-stable-7.4-${{ steps.composer-cache-vars.outputs.timestamp }}
28+
restore-keys: |
29+
${{ runner.os }}-composer-^11.5.5-stable-7.4-
30+
${{ runner.os }}-composer-^11.5.5-stable-
31+
${{ runner.os }}-composer-^11.5.5-
32+
${{ runner.os }}-composer-
33+
34+
- name: Set up PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: 7.4
38+
coverage: none
39+
40+
- name: "Extract tag, branch, version from GITHUB_REF"
41+
id: "github-ref"
42+
run: |
43+
echo "::set-output name=tag::$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/(.*)$#\1#p')"
44+
echo "::set-output name=branch::$(echo $GITHUB_REF | sed -E -n 's#^refs/heads/(.*)$#\1#p')"
45+
echo "::set-output name=version::$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/v?([0-9]+\.)([0-9]+\.)([0-9]+)#\1\2\3#p')"
46+
47+
- name: Deploy to TER
48+
run: |
49+
if [ -n "${{ secrets.TYPO3_ORG_USERNAME }}" ] && [ -n "${{ secrets.TYPO3_ORG_PASSWORD }}" ]; then
50+
echo -e "Preparing upload of release ${{ steps.github-ref.outputs.version }} to TER\n";
51+
# Install ter client
52+
composer global require helhum/ter-client
53+
PATH=$PATH:$(composer global config bin-dir --absolute --quiet);
54+
55+
# Upload
56+
TAG_MESSAGE=$(git tag -n10 -l ${{ steps.github-ref.outputs.tag }} | sed 's/^[v]*[0-9.]*[ ]*//g')
57+
echo "Uploading release ${{ steps.github-ref.outputs.version }} to TER"
58+
ter-client upload typoscript_rendering . -u "${{ secrets.TYPO3_ORG_USERNAME }}" -p "${{ secrets.TYPO3_ORG_PASSWORD }}" -m "$TAG_MESSAGE"
59+
fi;

‎.github/workflows/Test.yml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
11+
Tests:
12+
name: 'T3 ${{ matrix.typo3 }} - PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}'
13+
runs-on: ubuntu-18.04
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
typo3: [ '^9.5.0', '^10.4.0', '^11.5.0' ]
19+
php: [ '7.4' ]
20+
dependency-version: [ lowest, stable ]
21+
experimental: [ false ]
22+
include:
23+
- php: 7.2
24+
typo3: '^9.5.0'
25+
dependency-version: stable
26+
experimental: false
27+
- php: 7.3
28+
typo3: '^9.5.0'
29+
dependency-version: stable
30+
experimental: false
31+
- php: 7.2
32+
typo3: '^10.4.0'
33+
dependency-version: stable
34+
experimental: false
35+
- php: 7.3
36+
typo3: '^10.4.0'
37+
dependency-version: stable
38+
experimental: false
39+
- php: 8.0
40+
typo3: '^11.5.0'
41+
dependency-version: stable
42+
experimental: true
43+
44+
continue-on-error: ${{ matrix.experimental }}
45+
46+
steps:
47+
- name: Start database server
48+
run: sudo /etc/init.d/mysql start
49+
50+
- name: Checkout
51+
uses: actions/checkout@v2
52+
53+
- name: Composer Cache Vars
54+
id: composer-cache-vars
55+
run: |
56+
echo "::set-output name=dir::$(composer config cache-files-dir)"
57+
echo "::set-output name=timestamp::$(date +"%s")"
58+
59+
- name: Cache Composer dependencies
60+
uses: actions/cache@v2
61+
with:
62+
path: ${{ steps.composer-cache-vars.outputs.dir }}
63+
key: ${{ runner.os }}-composer-${{ matrix.typo3 }}-${{ matrix.dependency-version }}-${{ matrix.php }}-${{ steps.composer-cache-vars.outputs.timestamp }}
64+
restore-keys: |
65+
${{ runner.os }}-composer-${{ matrix.typo3 }}-${{ matrix.dependency-version }}-${{ matrix.php }}-
66+
${{ runner.os }}-composer-${{ matrix.typo3 }}-${{ matrix.dependency-version }}-
67+
${{ runner.os }}-composer-${{ matrix.typo3 }}-
68+
${{ runner.os }}-composer-
69+
70+
- name: Set up PHP Version ${{ matrix.php }}
71+
uses: shivammathur/setup-php@v2
72+
with:
73+
php-version: ${{ matrix.php }}
74+
tools: composer:v2
75+
coverage: none
76+
77+
- name: Environment Check
78+
run: |
79+
php --version
80+
composer --version
81+
82+
- name: Validate composer.json and composer.lock
83+
run: composer validate
84+
85+
- name: Install
86+
run: |
87+
composer update --with typo3/cms-core="${{ matrix.typo3 }}" --prefer-${{ matrix.dependency-version }} --prefer-dist --no-interaction
88+
89+
- name: Lint
90+
run: .Build/bin/parallel-lint --exclude vendor --exclude .Build .
91+
92+
- name: Unit Tests
93+
run: .Build/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/UnitTests.xml Tests/Unit/
94+
95+
- name: Functional Tests
96+
env:
97+
typo3DatabaseName: typo3
98+
typo3DatabaseHost: '127.0.0.1'
99+
typo3DatabaseUsername: root
100+
typo3DatabasePassword: root
101+
run: .Build/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml Tests/Functional/

‎.travis.yml

-89
This file was deleted.

‎Classes/Uri/TyposcriptRenderingUri.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ private function parseViewHelperContext(ViewHelperContext $viewHelperContext): v
8282
$additionalParams['tx_typoscriptrendering']['context'] = json_encode($renderingConfiguration);
8383

8484
$uriBuilder = $controllerContext->getUriBuilder();
85-
$uriBuilder->reset()
86-
->setUseCacheHash(true)
85+
$uriBuilder->reset();
86+
if (is_callable([$uriBuilder, 'setUseCacheHash'])) {
87+
$uriBuilder->setUseCacheHash(true);
88+
}
89+
$uriBuilder
8790
->setSection($arguments['section'] ?? '')
8891
->setFormat($arguments['format'] ?? 'html')
8992
->setLinkAccessRestrictedPages($arguments['linkAccessRestrictedPages'] ?? false)
@@ -101,8 +104,8 @@ private function parseViewHelperContext(ViewHelperContext $viewHelperContext): v
101104
$arguments['action'] ?? null,
102105
$arguments['arguments'] ?? null,
103106
$arguments['controller'] ?? null,
104-
$extensionName,
105-
$pluginName
107+
$extensionName ?? '',
108+
$pluginName ?? ''
106109
),
107110
$renderingPath !== null
108111
);

‎Tests/Functional/AbstractRenderingTestCase.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Nimut\TestingFramework\Http\Response;
1818
use Nimut\TestingFramework\TestCase\FunctionalTestCase;
1919
use PHPUnit\Util\PHP\DefaultPhpProcess;
20+
use SebastianBergmann\Template\Template;
2021
use TYPO3\CMS\Core\Utility\GeneralUtility;
2122

2223
/**
@@ -29,16 +30,17 @@ abstract class AbstractRenderingTestCase extends FunctionalTestCase
2930
*/
3031
protected $testExtensionsToLoad = ['typo3conf/ext/typoscript_rendering'];
3132

32-
/**
33-
* @var string[]
34-
*/
35-
protected $coreExtensionsToLoad = ['fluid'];
33+
protected $configurationToUseInTestInstance = [
34+
'SYS' => [
35+
'encryptionKey' => '42',
36+
],
37+
];
3638

37-
public function setUp()
39+
public function setUp(): void
3840
{
3941
parent::setUp();
4042
$this->importDataSet(__DIR__ . '/Fixtures/Database/pages.xml');
41-
$this->setUpFrontendRootPage(1, ['EXT:typoscript_rendering/Tests/Functional/Fixtures/Frontend/Basic.ts']);
43+
$this->setUpFrontendRootPage(1, ['EXT:typoscript_rendering/Tests/Functional/Fixtures/Frontend/Basic.typoscript']);
4244
}
4345

4446
/* ***********************************************
@@ -55,6 +57,7 @@ public function setUp()
5557
protected function getRenderUrl($pageId, $languageId, $path)
5658
{
5759
$requestArguments = ['id' => $pageId, 'L' => $languageId, 'path' => $path];
60+
5861
return $this->fetchFrontendResponse($requestArguments)->getContent();
5962
}
6063

@@ -77,7 +80,8 @@ protected function fetchFrontendResponse(array $requestArguments, $failOnFailure
7780
'requestUrl' => 'http://localhost' . $requestUrl,
7881
];
7982

80-
$template = new \Text_Template('ntf://Frontend/Request.tpl');
83+
$textTemplateClass = class_exists(Template::class) ? Template::class : \Text_Template::class;
84+
$template = new $textTemplateClass('ntf://Frontend/Request.tpl');
8185
$template->setVar(
8286
[
8387
'arguments' => var_export($arguments, true),
@@ -86,11 +90,7 @@ protected function fetchFrontendResponse(array $requestArguments, $failOnFailure
8690
]
8791
);
8892

89-
if (class_exists('PHPUnit_Util_PHP')) {
90-
$php = \PHPUnit_Util_PHP::factory();
91-
} else {
92-
$php = DefaultPhpProcess::factory();
93-
}
93+
$php = DefaultPhpProcess::factory();
9494
$response = $php->runJob($template->render());
9595
$result = json_decode($response['stdout'], true);
9696

‎Tests/Functional/FeNoPhpScriptIncludeRenderingTest.php

-37
This file was deleted.

‎Tests/Functional/Fixtures/Database/pages.xml

+14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@
44
<uid>1</uid>
55
<pid>0</pid>
66
<title>Root</title>
7+
<slug>/</slug>
78
<doktype>1</doktype>
9+
<sys_language_uid>0</sys_language_uid>
10+
<deleted>0</deleted>
11+
<perms_everybody>15</perms_everybody>
12+
</pages>
13+
<pages>
14+
<uid>2</uid>
15+
<pid>0</pid>
16+
<title>Root</title>
17+
<slug>/</slug>
18+
<doktype>1</doktype>
19+
<sys_language_uid>1</sys_language_uid>
20+
<l10n_parent>1</l10n_parent>
21+
<l10n_source>1</l10n_source>
822
<deleted>0</deleted>
923
<perms_everybody>15</perms_everybody>
1024
</pages>

‎Tests/Functional/Fixtures/Frontend/Basic.ts ‎Tests/Functional/Fixtures/Frontend/Basic.typoscript

-5
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,3 @@ page {
6060
returnLast = url
6161
}
6262
}
63-
64-
65-
[globalVar = GP:L = 1]
66-
config.sys_language_uid = 1
67-
[end]

‎Tests/Functional/RenderingTest.php

+33-26
Original file line numberDiff line numberDiff line change
@@ -14,80 +14,87 @@
1414
*
1515
*/
1616

17+
use TYPO3\CMS\Core\Package\Cache\PackageCacheInterface;
18+
1719
class RenderingTest extends AbstractRenderingTestCase
1820
{
1921
/**
2022
* @test
2123
*/
22-
public function urlGeneratedRespectAbsRefPrefixAndLinkVarsAndTarget()
24+
public function urlGeneratedRespectAbsRefPrefixAndLinkVarsAndTarget(): void
2325
{
2426
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.link')];
25-
$expectedContent = '<a href="/index.php?id=1&amp;L=1" target="_blank">link</a>';
26-
$this->assertSame($expectedContent, trim($this->fetchFrontendResponse($requestArguments)->getContent()));
27+
$expectedContent = '<a href="/da/" target="_blank">link</a>';
28+
$actualContent = trim($this->fetchFrontendResponse($requestArguments)->getContent());
29+
$this->assertSame($expectedContent, $actualContent);
2730
}
2831

2932
/**
3033
* @test
3134
*/
32-
public function emailViewHelperWorksAlsoWithSpamProtection()
35+
public function emailViewHelperWorksAlsoWithSpamProtection(): void
3336
{
3437
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.fluid')];
35-
$expectedContent = '<a href="javascript:linkTo_UnCryptMailto(\'ocknvq,kphqBjgnjwo0kq\');">info(AT)helhum(DOT)io</a>';
36-
$this->assertSame($expectedContent, trim($this->fetchFrontendResponse($requestArguments)->getContent()));
38+
$expectedContent = '<a href="#" data-mailto-token="ocknvq,kphqBjgnjwo0kq" data-mailto-vector="2">info(AT)helhum(DOT)io</a>';
39+
if (!interface_exists(PackageCacheInterface::class)) {
40+
$expectedContent = '<a href="javascript:linkTo_UnCryptMailto(%27ocknvq%2CkphqBjgnjwo0kq%27);">info(AT)helhum(DOT)io</a>';
41+
}
42+
$actualContent = trim($this->fetchFrontendResponse($requestArguments)->getContent());
43+
$this->assertSame($expectedContent, $actualContent);
3744
}
3845

3946
/**
4047
* @test
4148
*/
42-
public function viewHelperOutputsUri()
49+
public function viewHelperOutputsUri(): void
4350
{
4451
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.viewHelper')];
45-
$actualContentWithoutCHash = preg_replace('/&amp;cHash=[a-z0-9]*/', '', trim($this->fetchFrontendResponse($requestArguments)->getContent()));
46-
$expectedContent = '/index.php?id=1&amp;L=1&amp;tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&amp;tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo';
47-
$this->assertSame($expectedContent, $actualContentWithoutCHash);
52+
$expectedContent = '/da/?tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&amp;tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo&amp;cHash=05eba63c2a1d73fbdb2e4702e42fab9e';
53+
$actualContent = trim($this->fetchFrontendResponse($requestArguments)->getContent());
54+
$this->assertSame($expectedContent, $actualContent);
4855
}
4956

5057
/**
5158
* @test
5259
*/
53-
public function cObjectUriViewHelperOutputsUri()
60+
public function cObjectUriViewHelperOutputsUri(): void
5461
{
5562
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.cObjectUriViewHelper')];
56-
$actualContentWithoutCHash = preg_replace('/&amp;cHash=[a-z0-9]*/', '', trim($this->fetchFrontendResponse($requestArguments)->getContent()));
57-
$expectedContent = '/index.php?id=1&amp;L=1&amp;tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22lib.foo%22%7D';
58-
$this->assertSame($expectedContent, $actualContentWithoutCHash);
63+
$expectedContent = '/da/?tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22lib.foo%22%7D&amp;cHash=cb0d36cfb1819138f899192eda25168e';
64+
$actualContent = trim($this->fetchFrontendResponse($requestArguments)->getContent());
65+
$this->assertSame($expectedContent, $actualContent);
5966
}
6067

6168
/**
6269
* @test
6370
*/
64-
public function cObjectLinkViewHelperOutputsUri()
71+
public function cObjectLinkViewHelperOutputsUri(): void
6572
{
6673
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.cObjectLinkViewHelper')];
67-
$actualContentWithoutCHash = preg_replace('/&amp;cHash=[a-z0-9]*/', '', trim($this->fetchFrontendResponse($requestArguments)->getContent()));
68-
$expectedContent = '<a href="/index.php?id=1&amp;L=1&amp;tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22lib.foo%22%7D">Link</a>';
69-
$this->assertSame($expectedContent, $actualContentWithoutCHash);
74+
$expectedContent = '<a href="/da/?tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22lib.foo%22%7D&amp;cHash=cb0d36cfb1819138f899192eda25168e">Link</a>';
75+
$actualContent = trim($this->fetchFrontendResponse($requestArguments)->getContent());
76+
$this->assertSame($expectedContent, $actualContent);
7077
}
7178

7279
/**
7380
* @test
7481
*/
75-
public function oldViewHelperOutputsUri()
82+
public function oldViewHelperOutputsUri(): void
7683
{
7784
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.oldViewHelper')];
78-
$actualContentWithoutCHash = preg_replace('/&amp;cHash=[a-z0-9]*/', '', trim($this->fetchFrontendResponse($requestArguments)->getContent()));
79-
$expectedContent = '/index.php?id=1&amp;L=1&amp;tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&amp;tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo';
80-
$this->assertSame($expectedContent, $actualContentWithoutCHash);
85+
$expectedContent = '/da/?tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&amp;tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo&amp;cHash=05eba63c2a1d73fbdb2e4702e42fab9e';
86+
$actualContent = trim($this->fetchFrontendResponse($requestArguments)->getContent());
87+
$this->assertSame($expectedContent, $actualContent);
8188
}
8289

8390
/**
8491
* @test
8592
*/
86-
public function linkViewHelperOutputsUri()
93+
public function linkViewHelperOutputsUri(): void
8794
{
8895
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.linkViewHelper')];
89-
$actualContentWithoutCHash = preg_replace('/&amp;cHash=[a-z0-9]*/', '', trim($this->fetchFrontendResponse($requestArguments)->getContent()));
90-
$expectedContent = '<a href="/index.php?id=1&amp;L=1&amp;tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&amp;tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo">Link</a>';
91-
$this->assertSame($expectedContent, $actualContentWithoutCHash);
96+
$expectedContent = '<a href="/da/?tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&amp;tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo&amp;cHash=05eba63c2a1d73fbdb2e4702e42fab9e">Link</a>';
97+
$actualContent = trim($this->fetchFrontendResponse($requestArguments)->getContent());
98+
$this->assertSame($expectedContent, $actualContent);
9299
}
93100
}

‎Tests/Unit/Configuration/RecordRenderingConfigurationBuilderTest.php

+9-10
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
*
1414
*/
1515

16+
use Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException;
1617
use Helhum\TyposcriptRendering\Configuration\RecordRenderingConfigurationBuilder;
1718
use Helhum\TyposcriptRendering\Renderer\RenderingContext;
1819
use Nimut\TestingFramework\TestCase\UnitTestCase;
20+
use PHPUnit\Framework\MockObject\MockObject;
1921
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
2022

2123
/**
@@ -29,11 +31,11 @@ class RecordRenderingConfigurationBuilderTest extends UnitTestCase
2931
protected $configurationBuilder;
3032

3133
/**
32-
* @var TypoScriptFrontendController|\PHPUnit_Framework_MockObject_MockObject
34+
* @var TypoScriptFrontendController|MockObject
3335
*/
3436
protected $typoScriptControllerMock;
3537

36-
protected function setUp()
38+
protected function setUp(): void
3739
{
3840
$this->typoScriptControllerMock = $this->getMockBuilder('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController')
3941
->disableOriginalConstructor()
@@ -56,10 +58,7 @@ protected function setUp()
5658
];
5759
}
5860

59-
/**
60-
* @return array
61-
*/
62-
public function pluginContextDataProvider()
61+
public function pluginContextDataProvider(): array
6362
{
6463
return [
6564
'page specified' => [
@@ -133,19 +132,19 @@ public function pluginContextDataProvider()
133132
* @test
134133
* @dataProvider pluginContextDataProvider
135134
*/
136-
public function buildingConfigurationWorks($extensionName, $pluginName, $recordContext, array $expectedConfiguration)
135+
public function buildingConfigurationWorks($extensionName, $pluginName, $recordContext, array $expectedConfiguration): void
137136
{
138137
$this->typoScriptControllerMock->id = 42;
139138
$this->assertSame($expectedConfiguration, $this->configurationBuilder->configurationFor($extensionName, $pluginName, $recordContext));
140139
}
141140

142141
/**
143142
* @test
144-
* @expectedException \Helhum\TyposcriptRendering\Configuration\ConfigurationBuildingException
145-
* @expectedExceptionCode 1466779430
146143
*/
147-
public function buildingConfigurationThrowsExceptionIfRenderingConfigIsNotFound()
144+
public function buildingConfigurationThrowsExceptionIfRenderingConfigIsNotFound(): void
148145
{
146+
$this->expectException(ConfigurationBuildingException::class);
147+
$this->expectExceptionCode(1466779430);
149148
$this->configurationBuilder->configurationFor('News', 'Pi3', 'current');
150149
}
151150
}

‎Tests/Unit/Renderer/RecordRendererTest.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use Helhum\TyposcriptRendering\Renderer\RecordRenderer;
1818
use Helhum\TyposcriptRendering\Renderer\RenderingContext;
1919
use Nimut\TestingFramework\TestCase\UnitTestCase;
20+
use PHPUnit\Framework\MockObject\MockObject;
21+
use TYPO3\CMS\Core\Tests\AccessibleObjectInterface;
2022
use TYPO3\CMS\Core\Utility\GeneralUtility;
2123
use TYPO3\CMS\Core\Utility\RootlineUtility;
2224
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
@@ -27,24 +29,24 @@
2729
class RecordRendererTest extends UnitTestCase
2830
{
2931
/**
30-
* @var RecordRenderer|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
32+
* @var RecordRenderer|MockObject|AccessibleObjectInterface
3133
*/
3234
protected $renderer;
3335

34-
protected function setUp()
36+
protected function setUp(): void
3537
{
3638
$this->renderer = $this->getAccessibleMock('Helhum\\TyposcriptRendering\\Renderer\\RecordRenderer', ['dummy']);
3739
}
3840

39-
protected function tearDown()
41+
protected function tearDown(): void
4042
{
4143
GeneralUtility::purgeInstances();
4244
}
4345

4446
/**
4547
* @return array
4648
*/
47-
public function configurationDataProvider()
49+
public function configurationDataProvider(): array
4850
{
4951
return [
5052
'record id only' => [
@@ -106,9 +108,9 @@ public function configurationDataProvider()
106108
* @test
107109
* @dataProvider configurationDataProvider
108110
*/
109-
public function configurationIsGeneratedCorrectlyFromRequest(array $requestArguments, array $expectedConfiguration, $pageId = '42')
111+
public function configurationIsGeneratedCorrectlyFromRequest(array $requestArguments, array $expectedConfiguration, $pageId = '42'): void
110112
{
111-
/** @var TypoScriptFrontendController|\PHPUnit_Framework_MockObject_MockObject $tsfeMock */
113+
/** @var TypoScriptFrontendController|MockObject $tsfeMock */
112114
$tsfeMock = $this->getMockBuilder(TypoScriptFrontendController::class)
113115
->disableOriginalConstructor()
114116
->getMock();

‎composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
],
2222
"license": "GPL-2.0-or-later",
2323
"require": {
24-
"php": "^7.2",
25-
"typo3/cms-core": "^9.5.17 || ^10.4.2"
24+
"php": ">=7.2",
25+
"typo3/cms-core": "^9.5.31 || ^10.4.2 || ^11.5.5"
2626
},
2727
"require-dev": {
28-
"nimut/testing-framework": "^4.0 || ^5.0",
29-
"typo3/minimal": "^9.5"
28+
"nimut/testing-framework": "^6.0",
29+
"php-parallel-lint/php-parallel-lint": "^1.3"
3030
},
3131
"autoload": {
3232
"psr-4": {

0 commit comments

Comments
 (0)
Please sign in to comment.