$this->
expectDeprecation('Since symfony/console 6.1: Relying on the static property "$defaultDescription" for setting a command description is deprecated. Add the "Symfony\Component\Console\Attribute\AsCommand" attribute to the "Symfony\Component\Console\Tests\Command\MyCommand" class instead.'
);
$this->
assertSame('This is a command I wrote all by myself', MyCommand::
getDefaultDescription());
} /**
* @group legacy
*/
public function testStaticDefaultProperties() { $command =
new MyCommand();
$this->
assertSame('my:command',
$command->
getName());
$this->
assertSame('This is a command I wrote all by myself',
$command->
getDescription());
} public function testAttributeOverridesProperty() { $this->
assertSame('my:command', MyAnnotatedCommand::
getDefaultName());
$this->
assertSame('This is a command I wrote all by myself', MyAnnotatedCommand::
getDefaultDescription());
$command =
new MyAnnotatedCommand();