Skip to content

Commit 7f764d5

Browse files
authored
Merge pull request #131 from jolicode/up
Maintenance commit
2 parents a7e027d + 7a51b5a commit 7f764d5

26 files changed

+1065
-759
lines changed

.github/actions/phar/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
- name: Setup PHP
88
uses: shivammathur/setup-php@v2
99
with:
10-
php-version: '8.2'
10+
php-version: '8.3'
1111

1212
- name: Install dependencies (lib)
1313
run: composer install --prefer-dist --no-progress --no-dev --optimize-autoloader --classmap-authoritative

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
php-version: ["8.3", "8.4"]
41+
php-version: ["8.4", "8.5"]
4242
composer-flags: [""]
4343
name: [""]
4444
include:
45-
- php-version: 8.2
45+
- php-version: 8.3
4646
composer-flags: "--prefer-lowest"
4747
name: "(prefer lowest dependencies)"
4848
steps:
@@ -76,7 +76,7 @@ jobs:
7676
sudo apt-get install -y --no-install-recommends --no-install-suggests libnotify4
7777
7878
- name: Run Tests
79-
run: php vendor/bin/simple-phpunit
79+
run: php vendor/bin/phpunit
8080

8181
phar:
8282
name: Create a PHAR and ensure it is working

.php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
return (new PhpCsFixer\Config())
3131
->setRiskyAllowed(true)
3232
->setRules([
33-
'@PHP74Migration' => true,
33+
'@PHP83Migration' => true,
3434
'@PhpCsFixer' => true,
3535
'@Symfony' => true,
3636
'@Symfony:risky' => true,

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changes between versions
22

3+
## 3.3.0 (not released yet)
4+
5+
* Drop support for PHP 8.2
6+
* Phar are built with PHP 8.3
7+
* Add support for PHP 8.5
8+
39
## 3.2.0 (2025-10-16)
410

511
* Add support for Symfony 8.0

castor.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
use Castor\Attribute\AsRawTokens;
1313
use Castor\Attribute\AsTask;
1414

15+
use function Castor\guard_min_version;
1516
use function Castor\import;
1617
use function Castor\mount;
1718
use function Castor\run;
1819

20+
guard_min_version('1.0.0');
21+
1922
import(__DIR__ . '/tools/php-cs-fixer/castor.php');
2023
import(__DIR__ . '/tools/phpstan/castor.php');
2124

@@ -24,13 +27,13 @@
2427
#[AsTask(description: 'Install dependencies')]
2528
function install(): void
2629
{
27-
run(['composer', 'install'], workingDirectory: __DIR__);
30+
run(['composer', 'install']);
2831
qa\cs\install();
2932
qa\phpstan\install();
3033
}
3134

3235
#[AsTask(description: 'Run PHPUnit', ignoreValidationErrors: true)]
3336
function phpunit(#[AsRawTokens] array $rawTokens): void
3437
{
35-
run(['vendor/bin/simple-phpunit', ...$rawTokens]);
38+
run(['vendor/bin/phpunit', ...$rawTokens]);
3639
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
},
2323
"require": {
24-
"php": ">=8.2",
24+
"php": ">=8.3",
2525
"jolicode/php-os-helper": "^0.3",
2626
"psr/log": "^1.0 || ^2.0 || ^3.0",
2727
"symfony/process": "^6.4 || ^7.3 || ^8.0",
@@ -30,7 +30,7 @@
3030
"require-dev": {
3131
"monolog/monolog": "^3.9",
3232
"symfony/finder": "^6.4 || ^7.3 || ^8.0",
33-
"symfony/phpunit-bridge": "^7.3 || ^8.0"
33+
"phpunit/phpunit": "^12.4.5"
3434
},
3535
"suggest": {
3636
"ext-ffi": "Needed to send notifications via libnotify on Linux"

phpunit.xml.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.4/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
33
<php>
44
<ini name="error_reporting" value="-1"/>
55
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=13"/>
@@ -9,12 +9,12 @@
99
<directory>./tests/</directory>
1010
</testsuite>
1111
</testsuites>
12-
<coverage>
12+
<source>
1313
<include>
1414
<directory>./</directory>
1515
</include>
1616
<exclude>
1717
<directory>./vendor</directory>
1818
</exclude>
19-
</coverage>
19+
</source>
2020
</phpunit>

tests/Driver/AbstractCliBasedDriverTestTrait.php

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Joli\JoliNotif\Driver\DriverInterface;
1515
use Joli\JoliNotif\Notification;
1616
use JoliCode\PhpOsHelper\OsHelper;
17+
use PHPUnit\Framework\Attributes\DataProvider;
1718
use Symfony\Component\Process\Process;
1819

1920
/**
@@ -36,9 +37,7 @@ public function testIsSupported()
3637
$this->assertSame($supported, $this->getDriver()->isSupported());
3738
}
3839

39-
/**
40-
* @dataProvider provideValidNotifications
41-
*/
40+
#[DataProvider('provideValidNotifications')]
4241
public function testConfigureProcessAcceptAnyValidNotification(Notification $notification, string $expectedCommandLine)
4342
{
4443
try {
@@ -50,44 +49,44 @@ public function testConfigureProcessAcceptAnyValidNotification(Notification $not
5049
}
5150
}
5251

53-
public function provideValidNotifications(): iterable
52+
public static function provideValidNotifications(): iterable
5453
{
5554
$iconDir = self::getIconDir();
5655

5756
yield self::BINARY . '_getExpectedCommandLineForNotification' => [
5857
(new Notification())
5958
->setBody('I\'m the notification body'),
60-
$this->getExpectedCommandLineForNotification(),
59+
self::getExpectedCommandLineForNotification(),
6160
];
6261
yield self::BINARY . '_getExpectedCommandLineForNotificationWithATitle' => [
6362
(new Notification())
6463
->setBody('I\'m the notification body')
6564
->setTitle('I\'m the notification title'),
66-
$this->getExpectedCommandLineForNotificationWithATitle(),
65+
self::getExpectedCommandLineForNotificationWithATitle(),
6766
];
6867
yield self::BINARY . '_getExpectedCommandLineForNotificationWithASubtitle' => [
6968
(new Notification())
7069
->setBody('I\'m the notification body')
7170
->addOption('subtitle', 'I\'m the notification subtitle'),
72-
$this->getExpectedCommandLineForNotificationWithASubtitle(),
71+
self::getExpectedCommandLineForNotificationWithASubtitle(),
7372
];
7473
yield self::BINARY . '_getExpectedCommandLineForNotificationWithASound' => [
7574
(new Notification())
7675
->setBody('I\'m the notification body')
7776
->addOption('sound', 'Frog'),
78-
$this->getExpectedCommandLineForNotificationWithASound(),
77+
self::getExpectedCommandLineForNotificationWithASound(),
7978
];
8079
yield self::BINARY . '_getExpectedCommandLineForNotificationWithAnUrl' => [
8180
(new Notification())
8281
->setBody('I\'m the notification body')
8382
->addOption('url', 'https://google.com'),
84-
$this->getExpectedCommandLineForNotificationWithAnUrl(),
83+
self::getExpectedCommandLineForNotificationWithAnUrl(),
8584
];
8685
yield self::BINARY . '_getExpectedCommandLineForNotificationWithAnIcon' => [
8786
(new Notification())
8887
->setBody('I\'m the notification body')
8988
->setIcon($iconDir . '/image.gif'),
90-
$this->getExpectedCommandLineForNotificationWithAnIcon(),
89+
self::getExpectedCommandLineForNotificationWithAnIcon(),
9190
];
9291
yield self::BINARY . '_getExpectedCommandLineForNotificationWithAllOptions' => [
9392
(new Notification())
@@ -97,7 +96,7 @@ public function provideValidNotifications(): iterable
9796
->addOption('sound', 'Frog')
9897
->addOption('url', 'https://google.com')
9998
->setIcon($iconDir . '/image.gif'),
100-
$this->getExpectedCommandLineForNotificationWithAllOptions(),
99+
self::getExpectedCommandLineForNotificationWithAllOptions(),
101100
];
102101
}
103102

@@ -132,35 +131,35 @@ public function testSendThrowsExceptionWhenNotificationHasAnEmptyBody()
132131

133132
abstract protected function getDriver(): DriverInterface;
134133

135-
abstract protected function getExpectedCommandLineForNotification(): string;
134+
abstract protected static function getExpectedCommandLineForNotification(): string;
136135

137-
abstract protected function getExpectedCommandLineForNotificationWithATitle(): string;
136+
abstract protected static function getExpectedCommandLineForNotificationWithATitle(): string;
138137

139138
/**
140139
* Subtitle is supported only on few driver.
141140
*/
142-
protected function getExpectedCommandLineForNotificationWithASubtitle(): string
141+
protected static function getExpectedCommandLineForNotificationWithASubtitle(): string
143142
{
144-
return $this->getExpectedCommandLineForNotification();
143+
return static::getExpectedCommandLineForNotification();
145144
}
146145

147146
/**
148147
* Sound is supported only on few driver.
149148
*/
150-
protected function getExpectedCommandLineForNotificationWithASound(): string
149+
protected static function getExpectedCommandLineForNotificationWithASound(): string
151150
{
152-
return $this->getExpectedCommandLineForNotification();
151+
return static::getExpectedCommandLineForNotification();
153152
}
154153

155154
/**
156155
* Sound is supported only on few driver.
157156
*/
158-
protected function getExpectedCommandLineForNotificationWithAnUrl(): string
157+
protected static function getExpectedCommandLineForNotificationWithAnUrl(): string
159158
{
160-
return $this->getExpectedCommandLineForNotification();
159+
return static::getExpectedCommandLineForNotification();
161160
}
162161

163-
abstract protected function getExpectedCommandLineForNotificationWithAnIcon(): string;
162+
abstract protected static function getExpectedCommandLineForNotificationWithAnIcon(): string;
164163

165-
abstract protected function getExpectedCommandLineForNotificationWithAllOptions(): string;
164+
abstract protected static function getExpectedCommandLineForNotificationWithAllOptions(): string;
166165
}

tests/Driver/AppleScriptDriverTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,42 +52,42 @@ protected function getDriver(): AppleScriptDriver
5252
return new AppleScriptDriver(new NullLogger());
5353
}
5454

55-
protected function getExpectedCommandLineForNotification(): string
55+
protected static function getExpectedCommandLineForNotification(): string
5656
{
5757
return <<<'CLI'
5858
'osascript' '-e' 'display notification "I'\''m the notification body"'
5959
CLI;
6060
}
6161

62-
protected function getExpectedCommandLineForNotificationWithATitle(): string
62+
protected static function getExpectedCommandLineForNotificationWithATitle(): string
6363
{
6464
return <<<'CLI'
6565
'osascript' '-e' 'display notification "I'\''m the notification body" with title "I'\''m the notification title"'
6666
CLI;
6767
}
6868

69-
protected function getExpectedCommandLineForNotificationWithASubtitle(): string
69+
protected static function getExpectedCommandLineForNotificationWithASubtitle(): string
7070
{
7171
return <<<'CLI'
7272
'osascript' '-e' 'display notification "I'\''m the notification body" subtitle "I'\''m the notification subtitle"'
7373
CLI;
7474
}
7575

76-
protected function getExpectedCommandLineForNotificationWithASound(): string
76+
protected static function getExpectedCommandLineForNotificationWithASound(): string
7777
{
7878
return <<<'CLI'
7979
'osascript' '-e' 'display notification "I'\''m the notification body" sound name "Frog"'
8080
CLI;
8181
}
8282

83-
protected function getExpectedCommandLineForNotificationWithAnIcon(): string
83+
protected static function getExpectedCommandLineForNotificationWithAnIcon(): string
8484
{
8585
return <<<'CLI'
8686
'osascript' '-e' 'display notification "I'\''m the notification body"'
8787
CLI;
8888
}
8989

90-
protected function getExpectedCommandLineForNotificationWithAllOptions(): string
90+
protected static function getExpectedCommandLineForNotificationWithAllOptions(): string
9191
{
9292
return <<<'CLI'
9393
'osascript' '-e' 'display notification "I'\''m the notification body" with title "I'\''m the notification title" subtitle "I'\''m the notification subtitle" sound name "Frog"'

tests/Driver/GrowlNotifyDriverTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ protected function getDriver(): GrowlNotifyDriver
4040
return new GrowlNotifyDriver(new NullLogger());
4141
}
4242

43-
protected function getExpectedCommandLineForNotification(): string
43+
protected static function getExpectedCommandLineForNotification(): string
4444
{
4545
return <<<'CLI'
4646
'growlnotify' '--message' 'I'\''m the notification body'
4747
CLI;
4848
}
4949

50-
protected function getExpectedCommandLineForNotificationWithATitle(): string
50+
protected static function getExpectedCommandLineForNotificationWithATitle(): string
5151
{
5252
return <<<'CLI'
5353
'growlnotify' '--message' 'I'\''m the notification body' '--title' 'I'\''m the notification title'
5454
CLI;
5555
}
5656

57-
protected function getExpectedCommandLineForNotificationWithAnIcon(): string
57+
protected static function getExpectedCommandLineForNotificationWithAnIcon(): string
5858
{
5959
$iconDir = self::getIconDir();
6060

@@ -63,7 +63,7 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string
6363
CLI;
6464
}
6565

66-
protected function getExpectedCommandLineForNotificationWithAllOptions(): string
66+
protected static function getExpectedCommandLineForNotificationWithAllOptions(): string
6767
{
6868
$iconDir = self::getIconDir();
6969

0 commit comments

Comments
 (0)