Skip to content

Commit

Permalink
Merge pull request #230 from lemberg/feature/184-phpunit-upgrade
Browse files Browse the repository at this point in the history
Upgrade PHPUnit & drop support of PHP7.2
  • Loading branch information
T2L committed Nov 27, 2020
2 parents 2e384d5 + 494fbe2 commit 9b3a95f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/Integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ jobs:
strategy:
matrix:
php-version:
- '7.2'
- '7.3'
- '7.4'
composer-version:
- 1
- 2
include:
- php-version: '7.2'
- php-version: '7.3'
prefer-lowest: --prefer-lowest

steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Draft Environment (Unreleased)

Updates:
- [GH-184](https://github.com/lemberg/draft-environment/issues/184) - Drop support of PHP7.2 and bump minimum phpunit/phpunit version to ^9.3
- [GH-219](https://github.com/lemberg/draft-environment/issues/219) - Add support for Composer 2
- [GH-226](https://github.com/lemberg/draft-environment/issues/226) - Migrate from Travis to Github Actions

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is Vagrant-based development environment for Drupal projects. This project

## Prerequisites

- PHP (7.2+) and Composer
- PHP (^7.3) and Composer
- Vagrant (2.2.6+)
- VirtualBox (5.2+)
- [mkcert](https://mkcert.dev) (optional)
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Development environment for Draft Drupal.",
"license": "GPL-2.0-or-later",
"require": {
"php": "^7.2",
"php": "^7.3",
"composer-plugin-api": "^1.1 || ^2.0",
"nette/robot-loader": "^3.2",
"symfony/filesystem": "^3.4 || ^4.4 || ^5",
Expand All @@ -27,7 +27,7 @@
"phpstan/phpstan-deprecation-rules": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12",
"phpunit/phpunit": "^8.5 || ~9.0.0",
"phpunit/phpunit": "^9.3",
"slam/phpstan-extensions": "^5.0",
"symfony/process": "^3.4.3 || ^4.4 || ^5",
"thecodingmachine/phpstan-strict-rules": "^0.12"
Expand Down
16 changes: 9 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="vendor/autoload.php" colors="true"
<phpunit xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php" colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true">
<!-- Filter for coverage reports. -->
<coverage>
<include>
<directory>./src</directory>
</include>
</coverage>
<php>
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
Expand All @@ -18,12 +26,6 @@
<directory>./tests/Functional/</directory>
</testsuite>
</testsuites>
<!-- Filter for coverage reports. -->
<filter>
<whitelist>
<directory>./src</directory>
</whitelist>
</filter>
<extensions>
<extension class="Lemberg\Tests\Extensions\Draft\Environment\PHPUnit\Hook\BypassFinalHook"/>
</extensions>
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Config/Install/Step/InitConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ final public function testUninstall(): void {
$step->uninstall();

foreach ($configObject->getTargetConfigFilepaths(FALSE) as $filepath) {
self::assertFileNotExists($filepath);
self::assertFileDoesNotExist($filepath);
}
}

Expand All @@ -195,7 +195,7 @@ final public function testUninstallProcessGitIgnore(string $gitIgnoreContent, st
$step->uninstall();

if (preg_replace('/\R+/m', '', $expected) === '') {
self::assertFileNotExists($configObject->getTargetConfigFilepath(Config::TARGET_GITIGNORE));
self::assertFileDoesNotExist($configObject->getTargetConfigFilepath(Config::TARGET_GITIGNORE));
}
else {
self::assertSame($expected, file_get_contents($configObject->getTargetConfigFilepath(Config::TARGET_GITIGNORE)));
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Config/Manager/InstallManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function testInstall(): void {
$this->fs->remove($configObject->getTargetConfigFilepaths());
$this->configInstallManager->install();
foreach ($configObject->getTargetConfigFilepaths() as $filepath) {
self::assertFileNotExists($filepath);
self::assertFileDoesNotExist($filepath);
}
}

Expand Down Expand Up @@ -187,7 +187,7 @@ public function testUninstall(): void {
}
$this->configInstallManager->uninstall();
foreach ($configObject->getTargetConfigFilepaths(FALSE) as $filepath) {
self::assertFileNotExists($filepath);
self::assertFileDoesNotExist($filepath);
}
}

Expand Down

0 comments on commit 9b3a95f

Please sign in to comment.