2626use Joomla \Event \Dispatcher ;
2727use Joomla \Test \TestHelper ;
2828use PHPUnit \Framework \TestCase ;
29+ use PHPUnit \Framework \Attributes \DataProvider ;
2930use Psr \Container \ContainerInterface ;
3031use Psr \Container \NotFoundExceptionInterface ;
3132use Symfony \Component \Console \Exception \CommandNotFoundException ;
@@ -151,15 +152,17 @@ public function testSetGetVersion()
151152 /**
152153 * Data provider for testGetLongVersion
153154 *
154- * @return \Generator
155+ * @return array
155156 */
156- public function dataGetLongVersion (): \ Generator
157+ public static function dataGetLongVersionProvider (): array
157158 {
158159 // Args: App Name, App Version, Expected Return
159- yield 'Empty name and version ' => ['' , '' , 'Joomla Console Application ' ];
160- yield 'Name without version ' => ['Console Application ' , '' , 'Console Application ' ];
161- yield 'Version without name ' => ['' , '1.0.0 ' , 'Joomla Console Application <info>1.0.0</info> ' ];
162- yield 'Version with name ' => ['Console Application ' , '1.0.0 ' , 'Console Application <info>1.0.0</info> ' ];
160+ return [
161+ 'Empty name and version ' => ['' , '' , 'Joomla Console Application ' ],
162+ 'Name without version ' => ['Console Application ' , '' , 'Console Application ' ],
163+ 'Version without name ' => ['' , '1.0.0 ' , 'Joomla Console Application <info>1.0.0</info> ' ],
164+ 'Version with name ' => ['Console Application ' , '1.0.0 ' , 'Console Application <info>1.0.0</info> ' ],
165+ ];
163166 }
164167
165168 /**
@@ -171,6 +174,7 @@ public function dataGetLongVersion(): \Generator
171174 *
172175 * @dataProvider dataGetLongVersion
173176 */
177+ #[DataProvider('dataGetLongVersionProvider ' )]
174178 public function testGetLongVersion (string $ name , string $ version , string $ expected )
175179 {
176180 $ this ->object ->setName ($ name );
@@ -696,7 +700,7 @@ public function get($id)
696700 return $ this ->services [$ id ]($ this );
697701 }
698702
699- public function has ($ id )
703+ public function has (string $ id ): bool
700704 {
701705 return isset ($ this ->services [$ id ]);
702706 }
0 commit comments