diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d239c8b..429f08c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,13 @@ jobs: strategy: fail-fast: false matrix: - php: [ 7.2., 7.3, 7.4, 8.0 ] - contao: [ 4.4.*, 4.9.*, 4.10.* ] + php: [ 7.2, 7.3, 7.4, 8.0 ] + contao: [ 4.9.*, 4.13.* ] exclude: - - php: 8.0 - contao: 4.4.* - php: 7.2 - contao: 4.* + contao: 4.13.* + - php: 7.3 + contao: 4.13.* steps: - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -31,7 +31,7 @@ jobs: - name: Install the dependencies id: composer-install run: composer require contao/core-bundle:${{ matrix.contao }} --no-interaction - continue-on-error: ${{ matrix.php == 8.0 }} +# continue-on-error: ${{ matrix.contao == 4.13.* }} - name: Run the unit tests if: steps.composer-install.conclusion == 'success' && steps.composer-install.outcome == 'success' diff --git a/.gitignore b/.gitignore index 183f2a4..4278fde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ composer.lock .idea vendor +.phpunit.result.cache +.ddev diff --git a/CHANGELOG.md b/CHANGELOG.md index 63f4d74..6509a86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.5.9] - 2022-06-02 +- Fixed: warning in php 8 + ## [1.5.8] - 2022-03-25 - Fixed: exception if the templates folder does not exist ([#8], [@qzminski]) diff --git a/composer.json b/composer.json index 24d09ab..9292b7e 100644 --- a/composer.json +++ b/composer.json @@ -19,18 +19,14 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "contao/test-case": "1.1.*", - "contao/core-bundle": ">=4.4.0,<4.11", + "contao/core-bundle": "^4.13", + "contao/test-case": "^4.9", "contao/manager-plugin": "^2.0", "friendsofphp/php-cs-fixer": "^2.2", - "phpunit/phpunit": "^6.5", - "phpunit/phpunit-mock-objects": "^4.0|^5.0", - "phpunit/php-token-stream": "^1.4|^2.0|^3.0", - "php-http/guzzle6-adapter": "^1.1", - "php-http/message-factory": "^1.0.2", - "satooshi/php-coveralls": "^2.0", - "symfony/phpunit-bridge": "^3.2", - "heimrichhannot/contao-test-utilities-bundle": "^0.1.3" + "phpunit/phpunit": "^8.0", + "php-coveralls/php-coveralls": "^2.0", + "symfony/phpunit-bridge": "^4.4 || ^5.4", + "heimrichhannot/contao-test-utilities-bundle": "^0.1.5" }, "autoload": { "psr-4": { @@ -44,5 +40,11 @@ }, "extra": { "contao-manager-plugin": "HeimrichHannot\\TwigSupportBundle\\ContaoManager\\Plugin" + }, + "config": { + "allow-plugins": { + "contao-components/installer": true, + "contao/manager-plugin": true + } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 337c4e6..33a4bd5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,7 +12,7 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false"> +> diff --git a/src/Helper/NormalizerHelper.php b/src/Helper/NormalizerHelper.php index 4db7c88..15560a9 100644 --- a/src/Helper/NormalizerHelper.php +++ b/src/Helper/NormalizerHelper.php @@ -1,7 +1,7 @@ setAccessible(true); $data[$property] = $method->invoke($object); } else { - $data[$property] = $object->{$method->name}(); + $data[$property] = @$object->{$method->name}(); } if (\is_object($data[$property])) { diff --git a/tests/EventListener/RenderListenerTest.php b/tests/EventListener/RenderListenerTest.php index 562dc49..2059d73 100644 --- a/tests/EventListener/RenderListenerTest.php +++ b/tests/EventListener/RenderListenerTest.php @@ -1,7 +1,7 @@ createMock(EventDispatcherInterface::class); - $eventDispatcher->method('dispatch')->willReturnArgument(1); + $eventDispatcher->method('dispatch')->willReturnArgument(0); $parameters['eventDispatcher'] = $eventDispatcher; } @@ -185,7 +185,7 @@ public function testOnParseWidgetSkipTemplates() public function testPrepareContaoTemplateSkipOnException() { $dispatcher = $this->createMock(EventDispatcherInterface::class); - $dispatcher->method('dispatch')->willReturnCallback(function ($eventName, BeforeParseTwigTemplateEvent $event) { + $dispatcher->method('dispatch')->willReturnCallback(function (BeforeParseTwigTemplateEvent $event, $eventName = '') { if ('disabled' === $event->getTemplateName()) { throw new SkipTemplateException('SkipTemplateException'); } @@ -217,7 +217,7 @@ public function testPrepareContaoTemplateSkipOnException() public function testOnParseWidgetSkipOnException() { $dispatcher = $this->createMock(EventDispatcherInterface::class); - $dispatcher->method('dispatch')->willReturnCallback(function ($eventName, BeforeParseTwigTemplateEvent $event) { + $dispatcher->method('dispatch')->willReturnCallback(function (BeforeParseTwigTemplateEvent $event, $eventName = '') { if ('form_text' === $event->getTemplateName()) { throw new SkipTemplateException('SkipTemplateException'); } diff --git a/tests/Template/TwigFrontendTemplateTest.php b/tests/Template/TwigFrontendTemplateTest.php index e23c155..02a265f 100644 --- a/tests/Template/TwigFrontendTemplateTest.php +++ b/tests/Template/TwigFrontendTemplateTest.php @@ -1,7 +1,7 @@ getMockBuilder(TwigFrontendTemplate::class)->disableOriginalConstructor()->setMethods(null)->getMock(); - $container = $this->mockContainer(); + $container = $this->getContainerWithContaoConfiguration(); System::setContainer($container); $this->assertEmpty($instance->inherit());