44
55namespace Facile \TerminableLoop \Tests \Unit ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use Facile \TerminableLoop \AbstractTerminableCommand ;
89use PHPUnit \Framework \TestCase ;
910use Prophecy \Argument ;
@@ -78,17 +79,13 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
7879 $ stubCommand ->run (new ArrayInput ([]), $ output ->reveal ());
7980 }
8081
81- #[\ PHPUnit \ Framework \ Attributes \ DataProvider('signalProvider ' )]
82+ #[DataProvider('signalProvider ' )]
8283 public function testReceiveSignalDuringCommandBody (int $ signal ): void
8384 {
8485 $ stubCommand = new class ($ signal ) extends AbstractTerminableCommand {
85- /** @var int */
86- private $ signal ;
87-
88- public function __construct (int $ signal )
86+ public function __construct (private readonly int $ signal )
8987 {
9088 parent ::__construct ('dummy:command ' );
91- $ this ->signal = $ signal ;
9289 }
9390
9491 protected function commandBody (InputInterface $ input , OutputInterface $ output ): int
@@ -110,7 +107,7 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
110107 $ this ->assertSame (143 , $ exitCode );
111108 }
112109
113- #[\ PHPUnit \ Framework \ Attributes \ DataProvider('signalProvider ' )]
110+ #[DataProvider('signalProvider ' )]
114111 public function testReceiveSignalBeforeCommandBody (int $ signal ): void
115112 {
116113 $ stubCommand = $ this ->createStubTerminableCommand ();
@@ -129,7 +126,7 @@ public function testReceiveSignalBeforeCommandBody(int $signal): void
129126 $ this ->assertSame (143 , $ exitCode );
130127 }
131128
132- #[\ PHPUnit \ Framework \ Attributes \ DataProvider('signalProvider ' )]
129+ #[DataProvider('signalProvider ' )]
133130 public function testGetSubscribedSignals (int $ signal ): void
134131 {
135132 $ stubCommand = $ this ->createStubTerminableCommand ();
0 commit comments