Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1, 8.0, 7.4]
php: ['8.6', '8.5', '8.4']
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
coverage: none

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/pest
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
}
],
"require": {
"php": "^7.4|^8.0",
"spatie/macroable": "^1.0|^2.0",
"symfony/process": "^5.3|^6.0|^7.0|^8.0"
"php": "^8.4",
"spatie/macroable": "^2.0",
"symfony/process": "^7.0|^8.0"
},
"require-dev": {
"pestphp/pest": "^1.22",
"phpunit/phpunit": "^9.4",
"spatie/ssh": "^1.7.0",
"symfony/var-dumper": "^5.3|^6.0|^7.0|^8.0"
"pestphp/pest": "^4.0|^5.0",
"spatie/ssh": "^1.13.2",
"symfony/var-dumper": "^7.0|^8.0"
},
"autoload": {
"psr-4": {
Expand Down
25 changes: 6 additions & 19 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<testsuites>
<testsuite name="Spatie 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>
16 changes: 16 additions & 0 deletions tests/FeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@
->usePrivateKey(__DIR__.'/keys/spatie_docker_package_id_rsa');
});

afterEach(function () {
// Containers started with --rm are removed asynchronously after they stop,
// so wait until the name is free before the next test reuses it.
for ($attempt = 0; $attempt < 100; $attempt++) {
exec('docker inspect spatie_docker_test > /dev/null 2>&1', $output, $exitCode);

if ($exitCode !== 0) {
return;
}

exec('docker rm -f spatie_docker_test > /dev/null 2>&1');

usleep(100_000);
}
});

it('can start a container', function () {
$container = $this->container->start();

Expand Down
Loading