Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to PHP8.2 #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down
41 changes: 14 additions & 27 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
9 changes: 3 additions & 6 deletions tests/EuCookieConsentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down