MyAnnotatedCommand example

$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();

        $this->assertSame('my:command', $command->getName());
        $this->assertSame('This is a command I wrote all by myself', $command->getDescription());
    }

    public function testDefaultCommand()
    {
        $apl = new Application();
        $apl->setDefaultCommand(Php8Command::getDefaultName());
        $property = new \ReflectionProperty($apl, 'defaultCommand');

        
Home | Imprint | This part of the site doesn't use cookies.