Skip to content

Commit

Permalink
Support phpunit 9 (#66)
Browse files Browse the repository at this point in the history
* Support phpunit 9

* Update CHANGELOG.md

Co-authored-by: Tobias Nyholm <[email protected]>
  • Loading branch information
pl-github and Nyholm authored May 8, 2020
1 parent 9d89aa0 commit 32de23c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,26 @@ matrix:
fast_finish: true
include:
# Minimum supported Symfony version with the latest PHP version
- php: 7.2
- php: 7.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"

# Test the latest stable release
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"

# Force some major versions of Symfony
- php: 7.2
- php: 7.4
env: DEPENDENCIES="dunglas/symfony-lock:^2"
- php: 7.2
- php: 7.4
env: DEPENDENCIES="dunglas/symfony-lock:^3"
- php: 7.2
- php: 7.4
env: DEPENDENCIES="dunglas/symfony-lock:^4"

# Latest commit to master
- php: 7.2
- php: 7.4
env: STABILITY="dev"

allow_failures:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.2.0

- Support for PHPUnit9.

## 4.1.0

- Support for Symfony5.
Expand Down
4 changes: 3 additions & 1 deletion PhpUnit/ConfigurationValuesAreInvalidConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
$this->useRegExp = $useRegExp;
}

public function evaluate($other, $description = '', $returnResult = false)
public function evaluate($other, $description = '', $returnResult = false): ?bool
{
$this->validateConfigurationValuesArray($other);

Expand All @@ -39,6 +39,8 @@ public function evaluate($other, $description = '', $returnResult = false)
}

$this->fail($other, $description);

return null;
}

public function toString(): string
Expand Down
4 changes: 3 additions & 1 deletion PhpUnit/ConfigurationValuesAreValidConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct(ConfigurationInterface $configuration, $breadcrumbPa
parent::__construct($configuration, $breadcrumbPath);
}

public function evaluate($other, $description = '', $returnResult = false)
public function evaluate($other, $description = '', $returnResult = false): ?bool
{
$this->validateConfigurationValuesArray($other);

Expand All @@ -32,6 +32,8 @@ public function evaluate($other, $description = '', $returnResult = false)
if (!$success) {
$this->fail($other, $description);
}

return null;
}

public function toString(): string
Expand Down
2 changes: 1 addition & 1 deletion PhpUnit/ProcessedConfigurationEqualsConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(
parent::__construct($configuration, $breadcrumbPath);
}

public function evaluate($other, $description = '', $returnResult = false)
public function evaluate($other, $description = '', $returnResult = false): ?bool
{
$processedConfiguration = $this->processConfiguration($this->configurationValues);

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ public function processed_configuration_for_array_node_1(): void

## Version Guidance

| Version | Released | PHPUnit | Status |
|---------|--------------| ------------|------------|
| 4.x | Mar 5, 2018 | 7.x and 8.x | Latest |
| 3.x | Nov 30, 2017 | 6.x   | Bugfixes |
| 2.x | Jun 18, 2016 | 4.x and 5.x | EOL |
| 1.x | Oct 12, 2014 | 3.x | EOL
| Version | Released | PHPUnit | Status |
|---------|--------------| --------------------|------------|
| 4.x | Mar 5, 2018 | 7.x and 8.x and 9.x | Latest |
| 3.x | Nov 30, 2017 | 6.x   | Bugfixes |
| 2.x | Jun 18, 2016 | 4.x and 5.x | EOL |
| 1.x | Oct 12, 2014 | 3.x | EOL |
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"symfony/config": "^2.7 || ^3.4 || ^4.0 || ^5.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0 || ^8.0"
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
},
"conflict": {
"phpunit/phpunit": "<7.0"
Expand Down

0 comments on commit 32de23c

Please sign in to comment.