Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.2, 8.1, 8.0]
php: [8.3, 8.2, 8.1, 8.0]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ build
composer.lock
vendor
.phpunit.result.cache
.phpunit.cache
.php-cs-fixer.cache
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
}
],
"require": {
"php": "^7.2 | ^8.0 | ^8.1",
"php": "^7.2 | ^8.0",
"clue/stdio-react": "^2.4",
"jolicode/jolinotif": "^2.2",
"symfony/console": "^5 | ^6",
"symfony/finder": "^5.4 | ^6",
"symfony/process": "^5.4 | ^6",
"symfony/yaml": "^5.2 | ^6",
"symfony/console": "^5 | ^6 | ^7",
"symfony/finder": "^5.4 | ^6 | ^7",
"symfony/process": "^5.4 | ^6 | ^7",
"symfony/yaml": "^5.2 | ^6 | ^7",
"yosymfony/resource-watcher": "^2.0 | ^3.0"
},
"conflict": {
"yosymfony/resource-watcher": "<2.0",
"symfony/console": "<5.2"
},
"require-dev": {
"phpunit/phpunit": "^8.6 | ^9.0"
"phpunit/phpunit": "^8.6 | ^9.0 | ^11.0"
},
"autoload": {
"psr-4": {
Expand Down
23 changes: 12 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Spatie Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<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">
<coverage/>
<testsuites>
<testsuite name="Spatie Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion src/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __construct()
$this->add(new WatcherCommand());
}

public function getLongVersion()
public function getLongVersion(): string
{
return parent::getLongVersion().' by <comment>Spatie</comment>';
}
Expand Down
4 changes: 3 additions & 1 deletion src/WatcherCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected function configure()
->addArgument('phpunit-options', InputArgument::OPTIONAL, 'Options passed to phpunit');
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$options = $this->determineOptions($input);

Expand All @@ -28,6 +28,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->displayOptions($options, $input, $output);

$watcher->startWatching();

return 0;
}

protected function determineOptions(InputInterface $input): array
Expand Down
3 changes: 2 additions & 1 deletion tests/PhpunitWatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
use PHPUnit\Framework\TestCase;
use Spatie\PhpUnitWatcher\OS;
use Symfony\Component\Process\Process;
use PHPUnit\Framework\Attributes\Test;

class PhpunitWatcherTest extends TestCase
{
/** @test */
#[Test]
public function the_watcher_can_be_executed()
{
$process = new Process(OS::isOnWindows() ? ['php', 'phpunit-watcher'] : ['./phpunit-watcher']);
Expand Down
3 changes: 2 additions & 1 deletion tests/WatcherCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Spatie\PhpUnitWatcher\Test;

use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Spatie\PhpUnitWatcher\WatcherCommand;

class WatcherCommandTest extends TestCase
{
/** @test */
#[Test]
public function it_can_be_instantiated()
{
$command = new WatcherCommand();
Expand Down
7 changes: 4 additions & 3 deletions tests/WatcherFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

namespace Spatie\PhpUnitWatcher\Test;

use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Spatie\PhpUnitWatcher\WatcherFactory;

class WatcherFactoryTest extends TestCase
{
/** @test */
#[Test]
public function it_can_be_instantiated()
{
$factory = new WatcherFactory();

$this->assertInstanceOf(WatcherFactory::class, $factory);
}

/** @test */
#[Test]
public function setting_notification_preserves_other_options()
{
$userOptions = [
Expand All @@ -32,7 +33,7 @@ public function setting_notification_preserves_other_options()
$this->assertSame('*.php', $actualOptions['watch']['fileMask']);
}

/** @test */
#[Test]
public function setting_directories_preserves_other_options()
{
$userOptions = [
Expand Down