@@ -248,23 +248,42 @@ public function testVersion(): void
248248 $ this ->assertSame ($ versionProvider ->getVersion (), $ sake ->getVersion ());
249249 }
250250
251- public function testLegacyDevCommands (): void
251+ public static function provideLegacyDevCommands (): array
252+ {
253+ return [
254+ [
255+ 'command ' => 'dev ' ,
256+ 'correctName ' => 'list ' ,
257+ ],
258+ [
259+ 'command ' => 'dev/config ' ,
260+ 'correctName ' => 'config:dump ' ,
261+ ],
262+ [
263+ 'command ' => 'dev/tasks ' ,
264+ 'correctName ' => 'tasks ' ,
265+ ],
266+ // NOTE: Do not run `dev/build` as that will manipulate the database in a way that causes subsequent tests to fail.
267+ ];
268+ }
269+
270+ #[DataProvider('provideLegacyDevCommands ' )]
271+ public function testLegacyDevCommands (string $ command , string $ correctName ): void
252272 {
253273 $ sake = new Sake (Injector::inst ()->get (Kernel::class));
254274 $ sake ->setAutoExit (false );
255- $ input = new ArrayInput ([' dev/config ' ]);
275+ $ input = new ArrayInput ([$ command , ' --quiet ' => 1 ]);
256276 $ input ->setInteractive (false );
257277 $ output = new BufferedOutput ();
258278
259279 $ deprecationsWereEnabled = Deprecation::isEnabled ();
260280 Deprecation::enable ();
261281 $ this ->expectException (DeprecationTestException::class);
262- $ expectedErrorString = ' Using the command with the name \' dev/config \ ' is deprecated. Use \' config:dump \ ' instead ' ;
282+ $ expectedErrorString = " Using the command with the name ' $ command ' is deprecated. Use ' $ correctName ' instead " ;
263283 $ this ->expectExceptionMessage ($ expectedErrorString );
264284
265285 $ exitCode = $ sake ->run ($ input , $ output );
266286 $ this ->assertSame (0 , $ exitCode , 'command should run successfully ' );
267- // $this->assertStringContainsString('abababa', $output->fetch());
268287
269288 $ this ->allowCatchingDeprecations ($ expectedErrorString );
270289 try {
0 commit comments