From dd7e7e7f080051d2c34dfdd16171d0fa3b836f06 Mon Sep 17 00:00:00 2001 From: Torben Evald Hanen Date: Sun, 2 Jun 2024 03:52:44 +0200 Subject: [PATCH] Update PHP and PHPUnit, add extensions, remove unsupported metadata in doc-comment for tests --- composer.json | 10 +++++---- phpunit.xml.dist | 41 ++++++++++++----------------------- tests/EuCookieConsentTest.php | 9 +++----- 3 files changed, 23 insertions(+), 37 deletions(-) diff --git a/composer.json b/composer.json index fa4c255..a0cb60e 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,14 @@ } ], "require": { - "php": ">7.1", + "php": "^8.2", + "ext-dom": "*", + "ext-mbstring": "*", "illuminate/support": "*" }, "require-dev": { - "orchestra/testbench": "^5.2", - "phpunit/phpunit": "^8.0" + "orchestra/testbench": "^9.0", + "phpunit/phpunit": "^11.0.0" }, "autoload": { "psr-4": { @@ -35,7 +37,7 @@ }, "scripts": { "test": "vendor/bin/phpunit", - "test-coverage": "vendor/bin/phpunit --coverage-html coverage" + "test-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html coverage" }, "config": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 764a2f2..fd65970 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,29 +1,16 @@ - - - - tests - - - - - src/ - - - - - - - - - + + + + tests + + + + + + + + src/ + + diff --git a/tests/EuCookieConsentTest.php b/tests/EuCookieConsentTest.php index 10faf6c..edc4776 100644 --- a/tests/EuCookieConsentTest.php +++ b/tests/EuCookieConsentTest.php @@ -15,22 +15,19 @@ protected function getPackageProviders($app) return [EuCookieConsentServiceProvider::class]; } - /** @test */ - public function can_I_Use_for_not_set_cookie_returns_false() + public function test_can_I_Use_for_not_set_cookie_returns_false() { $canIUse = EuCookieConsent::canIUse('not_defined'); $this->assertFalse($canIUse); } - /** @test */ - public function getPopup_returns_html_if_cookie_is_not_set() + public function test_getPopup_returns_html_if_cookie_is_not_set() { $popup = EuCookieConsent::getPopup(); $this->assertNotEmpty($popup); } - /** @test */ - public function getPopup_returns_empty_string_if_cookie_is_not_set() + public function test_getPopup_returns_empty_string_if_cookie_is_not_set() { $html = EuCookieConsent::getHTML('header'); $this->assertEmpty($html);