N98\Magento\Command\Cms\Block\ToggleCommandTest::testExecute PHP Method

testExecute() public method

public testExecute ( )
    public function testExecute()
    {
        $application = $this->getApplication();
        $application->add(new ToggleCommand());
        $command = $this->getApplication()->find('cms:block:toggle');
        $commandTester = new CommandTester($command);
        $victim = \Mage::getModel('cms/block')->getCollection()->getFirstItem();
        $commandTester->execute(array('command' => $command->getName(), 'block_id' => $victim->getId()));
        $this->assertContains('disabled', $commandTester->getDisplay());
        $commandTester->execute(array('command' => $command->getName(), 'block_id' => $victim->getIdentifier()));
        $this->assertContains('enabled', $commandTester->getDisplay());
    }
ToggleCommandTest