diff --git a/.gitignore b/.gitignore index 7827e89..c904f51 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,5 @@ # Tools /build/ -/.php_cs.cache /.php-cs-fixer.cache /.phpunit.result.cache diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 0073958..a4d805a 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -10,13 +10,13 @@ */ $fileHeaderComment = <<<'EOF' -This file is part of the JoliNotif project. + This file is part of the JoliNotif project. -(c) Loïck Piera + (c) Loïck Piera -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; + For the full copyright and license information, please view the LICENSE + file that was distributed with this source code. + EOF; $finder = PhpCsFixer\Finder::create() ->in(__DIR__) @@ -30,7 +30,7 @@ ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, - '@PHP71Migration' => true, + '@PHP74Migration' => true, '@PhpCsFixer' => true, 'php_unit_internal_class' => false, // From @PhpCsFixer but we don't want it 'php_unit_test_class_requires_covers' => false, // From @PhpCsFixer but we don't want it diff --git a/tests/NotificationTest.php b/tests/NotificationTest.php index 87dace4..cd3f2c0 100644 --- a/tests/NotificationTest.php +++ b/tests/NotificationTest.php @@ -32,15 +32,15 @@ public function testItExtractsIconFromPhar() } $bootstrap = <<<'PHAR_BOOTSTRAP' -setBody('My notification'); -$notification->setIcon(__DIR__.$iconPath); -PHAR_BOOTSTRAP; + $iconPath = '/{{ THE_ICON }}'; + $notification = new \Joli\JoliNotif\Notification(); + $notification->setBody('My notification'); + $notification->setIcon(__DIR__.$iconPath); + PHAR_BOOTSTRAP; $files = (new Finder()) ->in("{$rootPackage}/src") diff --git a/tests/Notifier/AppleScriptNotifierTest.php b/tests/Notifier/AppleScriptNotifierTest.php index 2c6815f..6b1fa0f 100644 --- a/tests/Notifier/AppleScriptNotifierTest.php +++ b/tests/Notifier/AppleScriptNotifierTest.php @@ -57,8 +57,8 @@ protected function getNotifier(): Notifier protected function getExpectedCommandLineForNotification(): string { return <<<'CLI' -'osascript' '-e' 'display notification "I'\''m the notification body"' -CLI; + 'osascript' '-e' 'display notification "I'\''m the notification body"' + CLI; } /** @@ -67,8 +67,8 @@ protected function getExpectedCommandLineForNotification(): string protected function getExpectedCommandLineForNotificationWithATitle(): string { return <<<'CLI' -'osascript' '-e' 'display notification "I'\''m the notification body" with title "I'\''m the notification title"' -CLI; + 'osascript' '-e' 'display notification "I'\''m the notification body" with title "I'\''m the notification title"' + CLI; } /** @@ -77,8 +77,8 @@ protected function getExpectedCommandLineForNotificationWithATitle(): string protected function getExpectedCommandLineForNotificationWithASubtitle(): string { return <<<'CLI' -'osascript' '-e' 'display notification "I'\''m the notification body" subtitle "I'\''m the notification subtitle"' -CLI; + 'osascript' '-e' 'display notification "I'\''m the notification body" subtitle "I'\''m the notification subtitle"' + CLI; } /** @@ -87,8 +87,8 @@ protected function getExpectedCommandLineForNotificationWithASubtitle(): string protected function getExpectedCommandLineForNotificationWithASound(): string { return <<<'CLI' -'osascript' '-e' 'display notification "I'\''m the notification body" sound name "Frog"' -CLI; + 'osascript' '-e' 'display notification "I'\''m the notification body" sound name "Frog"' + CLI; } /** @@ -97,8 +97,8 @@ protected function getExpectedCommandLineForNotificationWithASound(): string protected function getExpectedCommandLineForNotificationWithAnIcon(): string { return <<<'CLI' -'osascript' '-e' 'display notification "I'\''m the notification body"' -CLI; + 'osascript' '-e' 'display notification "I'\''m the notification body"' + CLI; } /** @@ -107,7 +107,7 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string protected function getExpectedCommandLineForNotificationWithAllOptions(): string { return <<<'CLI' -'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"' -CLI; + '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"' + CLI; } } diff --git a/tests/Notifier/GrowlNotifyNotifierTest.php b/tests/Notifier/GrowlNotifyNotifierTest.php index dac7798..bfb59d3 100644 --- a/tests/Notifier/GrowlNotifyNotifierTest.php +++ b/tests/Notifier/GrowlNotifyNotifierTest.php @@ -45,8 +45,8 @@ protected function getNotifier(): Notifier protected function getExpectedCommandLineForNotification(): string { return <<<'CLI' -'growlnotify' '--message' 'I'\''m the notification body' -CLI; + 'growlnotify' '--message' 'I'\''m the notification body' + CLI; } /** @@ -55,8 +55,8 @@ protected function getExpectedCommandLineForNotification(): string protected function getExpectedCommandLineForNotificationWithATitle(): string { return <<<'CLI' -'growlnotify' '--message' 'I'\''m the notification body' '--title' 'I'\''m the notification title' -CLI; + 'growlnotify' '--message' 'I'\''m the notification body' '--title' 'I'\''m the notification title' + CLI; } /** @@ -67,8 +67,8 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string $iconDir = $this->getIconDir(); return <<getIconDir(); return <<getIconDir(); return <<getIconDir(); return <<getIconDir(); return <<getIconDir(); return <<getIconDir(); return <<getIconDir(); return <<getIconDir(); return <<getIconDir(); return <<getIconDir(); return <<getIconDir(); return << -PHAR_BOOTSTRAP; + ?> + PHAR_BOOTSTRAP; $files = (new Finder()) ->in("{$rootPackage}/src")