Skip to content

Commit

Permalink
Now that we're only running one version of PHPUnit in CI, upgrade to …
Browse files Browse the repository at this point in the history
…PHPUnit 11.x
  • Loading branch information
stevegrunwell committed Aug 20, 2024
1 parent cce7ce6 commit 3140259
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DS_Store
.phpunit.result.cache
.phpunit.cache
.vscode
composer.lock
phpcs.xml
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^6.5 | ^8.5 | ^9.5 | ^10.0",
"phpunit/phpunit": "^11.3",
"squizlabs/php_codesniffer": "^3.10"
},
"autoload": {
Expand Down
20 changes: 10 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<phpunit
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite name="Core">
<directory suffix="Test.php">tests/</directory>
</testsuite>
</testsuites>
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
cacheDirectory=".phpunit.cache"
>
<testsuites>
<testsuite name="Core">
<directory suffix="Test.php">tests/</directory>
</testsuite>
</testsuites>
</phpunit>
6 changes: 4 additions & 2 deletions tests/ConstantsTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

declare(strict_types=1);

namespace Tests;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -14,13 +17,12 @@ class ConstantsTest extends TestCase
/**
* Ensure that each constant is defined and matches the expected value.
*
* @dataProvider constantsProvider
*
* @param string $constant The name of the constant.
* @param int $expected The expected value for the constant.
*
* @return void
*/
#[DataProvider('constantsProvider')]
public function testConstantsAreDefined(string $constant, int $expected)
{
$this->assertTrue(defined($constant), "Expected the '{$constant}' constant to be defined.");
Expand Down

0 comments on commit 3140259

Please sign in to comment.