Browse Source

Merge pull request #228 from edpauto/commands-help

Handle '--help' option for commands
1.0
Kuba Turek 10 years ago
parent
commit
c69d8888f5
  1. 136
      Mage/Command/AbstractCommand.php
  2. 15
      Mage/Command/BuiltIn/AddCommand.php
  3. 4
      Mage/Command/BuiltIn/CompileCommand.php
  4. 16
      Mage/Command/BuiltIn/DeployCommand.php
  5. 14
      Mage/Command/BuiltIn/InitCommand.php
  6. 18
      Mage/Command/BuiltIn/InstallCommand.php
  7. 11
      Mage/Command/BuiltIn/ListCommand.php
  8. 15
      Mage/Command/BuiltIn/LockCommand.php
  9. 30
      Mage/Command/BuiltIn/ReleasesCommand.php
  10. 18
      Mage/Command/BuiltIn/RollbackCommand.php
  11. 11
      Mage/Command/BuiltIn/UnlockCommand.php
  12. 7
      Mage/Command/BuiltIn/UpdateCommand.php
  13. 7
      Mage/Command/BuiltIn/UpgradeCommand.php
  14. 6
      Mage/Command/BuiltIn/VersionCommand.php
  15. 15
      Mage/Console.php
  16. 224
      tests/MageTest/Command/AbstractCommandTest.php
  17. 1
      tests/MageTest/Command/BuiltIn/CompileCommandTest.php
  18. 2
      tests/MageTest/Command/BuiltIn/ListCommandTest.php
  19. 1
      tests/MageTest/Command/BuiltIn/LockCommandTest.php
  20. 1
      tests/MageTest/Command/BuiltIn/UnlockCommandTest.php
  21. 6
      tests/MageTest/Command/BuiltIn/VersionCommandTest.php

136
Mage/Command/AbstractCommand.php

@ -26,6 +26,34 @@ abstract class AbstractCommand
*/ */
protected $config = null; protected $config = null;
/**
* Command's help message
*
* @var string
*/
private $helpMessage;
/**
* Usage examples.
*
* @var array
*/
private $usageExamples = array();
/**
* Command's syntax message
*
* @var string
*/
private $syntaxMessage;
/**
* Command name
*
* @var string
*/
private $name;
/** /**
* Runs the Command * Runs the Command
* @return integer exit code * @return integer exit code
@ -52,4 +80,112 @@ abstract class AbstractCommand
{ {
return $this->config; return $this->config;
} }
/**
* Sets command name
*
* @param string $name Command name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Sets command's help message
*
* @param string $message Command's help message
* @return $this
*/
public function setHelpMessage($message)
{
$this->helpMessage = $message;
return $this;
}
/**
* Adds command's usage example
*
* @param string $snippet Example's snippet
* @param string $description Example's description
* @return $this
*/
public function addUsageExample($snippet, $description = '')
{
array_push($this->usageExamples, array($snippet, $description));
return $this;
}
/**
* Sets command's syntax message
*
* @param string $message Syntax message
* @return $this
*/
public function setSyntaxMessage($message)
{
$this->syntaxMessage = $message;
return $this;
}
/**
* Returns formatted command info
*
* @return string
*/
public function getInfoMessage()
{
$indent = str_repeat(" ", 4);
$output = "";
if (!empty($this->name)) {
$output .= "\n";
$output .= "<cyan><bold>Command: </bold></cyan>";
$output .= $this->name;
}
if (!empty($this->helpMessage)) {
$output .= "\n";
$output .= "<light_blue>{$this->helpMessage}</light_blue>\n";
}
if (!empty($this->syntaxMessage)) {
$output .= "\n";
$output .= "<light_gray><bold>Syntax:</bold></light_gray>\n";
$output .= "$indent<light_green>{$this->syntaxMessage}</light_green>";
$output .= "\n";
}
if (!empty($this->usageExamples)) {
$output .= "\n";
$output .= "<light_gray><bold>Usage examples:</bold></light_gray>\n";
foreach ($this->usageExamples as $example) {
$snippet = $example[0];
$description = $example[1];
$output .= "$indent* ";
if (!empty($description)) {
$description = rtrim($description, ': ') . ":";
$output .= $description;
$output .= "\n$indent$indent";
}
$output .= "<green>$snippet</green>";
$output .= "\n";
}
}
if (empty($output)) {
$output .= "\n";
$output .= "<red><bold>Sorry, there's no help for this command at the moment.</bold></red>";
$output .= "\n";
}
return $output;
}
} }

15
Mage/Command/BuiltIn/AddCommand.php

@ -23,6 +23,21 @@ use Exception;
*/ */
class AddCommand extends AbstractCommand class AddCommand extends AbstractCommand
{ {
public function __construct()
{
$this->setName('Add command')
->setHelpMessage('Generates new config for Magallanes. For now, only adding a environment is possible')
->setSyntaxMessage('mage add [environment] [--name=env_name] [--enableReleases]')
->addUsageExample(
'mage add environment --name=production',
'Add a production environment'
)
->addUsageExample(
'mage add environment --name=qa --enableReleases',
'Add a QA environment and enable releasing'
);
}
/** /**
* Adds new Configuration Elements * Adds new Configuration Elements
* @see \Mage\Command\AbstractCommand::run() * @see \Mage\Command\AbstractCommand::run()

4
Mage/Command/BuiltIn/CompileCommand.php

@ -33,6 +33,10 @@ class CompileCommand extends AbstractCommand
} }
$this->compiler = $compiler; $this->compiler = $compiler;
$this->setName('Compile command')
->setHelpMessage('Compiles Magallanes to mage.phar file')
->setSyntaxMessage('mage compile');
} }
/** /**

16
Mage/Command/BuiltIn/DeployCommand.php

@ -103,6 +103,22 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
*/ */
protected static $failedTasks = 0; protected static $failedTasks = 0;
public function __construct()
{
$this->setName('Deploy command')
->setHelpMessage('Deploys the project into target environment')
->setSyntaxMessage('mage deploy to:[environment_name]')
->addUsageExample(
'mage deploy to:production',
'Deploy the project into <bold>production</bold> environment'
)
->addUsageExample(
'mage deploy to:production --overrideRelease',
'Deploy the project into <bold>production</bold> environment '
. 'but skip <bold>SkipOnOverride</bold> aware tasks'
);
}
/** /**
* Returns the Status of the Deployment * Returns the Status of the Deployment
* *

14
Mage/Command/BuiltIn/InitCommand.php

@ -20,6 +20,20 @@ use Mage\Console;
*/ */
class InitCommand extends AbstractCommand class InitCommand extends AbstractCommand
{ {
public function __construct()
{
$this->setName('Initialize command')
->setHelpMessage('Initialize Magallanes project, create .mage directory with starter configs')
->setSyntaxMessage('mage init --name=[project_name] [--email=[author_email]]')
->addUsageExample(
'mage init --name="My awesome project"',
'Initialize "My awesome project" configuration'
)
->addUsageExample(
'mage init --name="My project" --email="john.smith@example.com"',
'Initialize "My project" configuration with email notification enabled for john.smith@example.com'
);
}
/** /**
* Command for Initalize a new Configuration Proyect * Command for Initalize a new Configuration Proyect

18
Mage/Command/BuiltIn/InstallCommand.php

@ -20,6 +20,24 @@ use Mage\Console;
*/ */
class InstallCommand extends AbstractCommand class InstallCommand extends AbstractCommand
{ {
public function __construct()
{
$this->setName('Install command')
->setHelpMessage(
'Installs Magallanes system-widely.'
. ' By default, Magallanes\' going to be installed in /opt/magallanes'
)
->setSyntaxMessage('mage install [--installDir=[install_directory]] [--systemWide]')
->addUsageExample(
'mage install --installDir=/src/projects/Magellanes',
'Install Magallanes at /src/projects/Magallanes directory'
)
->addUsageExample(
'mage install --systemWide',
'Install Magallanes at default directory and creates a symlink in /usr/bin/mage'
);
}
/** /**
* Installs Magallanes * Installs Magallanes
* @see \Mage\Command\AbstractCommand::run() * @see \Mage\Command\AbstractCommand::run()

11
Mage/Command/BuiltIn/ListCommand.php

@ -23,6 +23,17 @@ use Exception;
*/ */
class ListCommand extends AbstractCommand class ListCommand extends AbstractCommand
{ {
public function __construct()
{
$this->setName('List command')
->setHelpMessage('List available configurations. For now, only environments listing available')
->setSyntaxMessage('mage list [environments]')
->addUsageExample(
'mage list environments',
'List currently configured environments'
);
}
/** /**
* Command for Listing Configuration Elements * Command for Listing Configuration Elements
* @see \Mage\Command\AbstractCommand::run() * @see \Mage\Command\AbstractCommand::run()

15
Mage/Command/BuiltIn/LockCommand.php

@ -21,6 +21,21 @@ use Mage\Console;
*/ */
class LockCommand extends AbstractCommand implements RequiresEnvironment class LockCommand extends AbstractCommand implements RequiresEnvironment
{ {
public function __construct()
{
$this->setName('Lock command')
->setHelpMessage(
"Locks the deployment to given environment and creates a lock file "
. "with lock reason and lock performer.\n"
. "You are going to be prompted to provide this information"
)
->setSyntaxMessage('mage lock to:[environment_name]')
->addUsageExample(
'mage lock to:production',
'Create a lock to production environment deployment'
);
}
/** /**
* Locks the Deployment to a Environment * Locks the Deployment to a Environment
* @see \Mage\Command\AbstractCommand::run() * @see \Mage\Command\AbstractCommand::run()

30
Mage/Command/BuiltIn/ReleasesCommand.php

@ -22,6 +22,36 @@ use Mage\Console;
*/ */
class ReleasesCommand extends AbstractCommand implements RequiresEnvironment class ReleasesCommand extends AbstractCommand implements RequiresEnvironment
{ {
public function __construct()
{
$this->setName('Releases management command')
->setHelpMessage('Manages releases')
->setSyntaxMessage(
'mage releases [list|rollback [--release=[release_id]]] '
. 'to:[environment_name] [--deleteCurrent]'
)
->addUsageExample(
'mage releases list to:production',
'List releases on production environment'
)
->addUsageExample(
'mage releases rollback --release=20120101172148 to:production',
'Rollback 20120101172148 release on production environment'
)
->addUsageExample(
'mage releases rollback --release=-1 to:production',
'Rollback <bold>list release -1</bold> release on production environment'
)
->addUsageExample(
'mage releases rollback --release=0 to:production',
'Rollback last release on production environment'
)
->addUsageExample(
'mage releases rollback -1 to:production --deleteCurrent',
'Rollbacks the <bold>last release -1</bold> release and removes current release'
);
}
/** /**
* List the Releases, Rollback to a Release * List the Releases, Rollback to a Release
* @see \Mage\Command\AbstractCommand::run() * @see \Mage\Command\AbstractCommand::run()

18
Mage/Command/BuiltIn/RollbackCommand.php

@ -22,6 +22,24 @@ use Mage\Console;
*/ */
class RollbackCommand extends AbstractCommand implements RequiresEnvironment class RollbackCommand extends AbstractCommand implements RequiresEnvironment
{ {
public function __construct()
{
$this->setName('Rollback command')
->setHelpMessage('Rollbacks the release by given release id or index')
->setSyntaxMessage('mage rollback [releaseId] to:[environment_name]')
->addUsageExample(
'mage rollback 20120101172148 to:production',
'Rollbacks the 20120101172148 release on production environment'
)
->addUsageExample(
'mage rollback -1 to:production',
'Rollbacks the <bold>last release -1</bold> release'
)
->addUsageExample(
'mage rollback -1 to:production --deleteCurrent',
'Rollbacks the <bold>last release -1</bold> release and removes current release'
);
}
/** /**
* Rollback a release * Rollback a release
* @see \Mage\Command\AbstractCommand::run() * @see \Mage\Command\AbstractCommand::run()

11
Mage/Command/BuiltIn/UnlockCommand.php

@ -21,6 +21,17 @@ use Mage\Console;
*/ */
class UnlockCommand extends AbstractCommand implements RequiresEnvironment class UnlockCommand extends AbstractCommand implements RequiresEnvironment
{ {
public function __construct()
{
$this->setName('Unlock command')
->setHelpMessage('Unlocks deployment for given environment')
->setSyntaxMessage('mage unlock to:[environment_name]')
->addUsageExample(
'mage unlock to:production',
'Removes the lock form production environment deployment'
);
}
/** /**
* Unlocks an Environment * Unlocks an Environment
* @see \Mage\Command\AbstractCommand::run() * @see \Mage\Command\AbstractCommand::run()

7
Mage/Command/BuiltIn/UpdateCommand.php

@ -21,6 +21,13 @@ use Mage\Console;
*/ */
class UpdateCommand extends AbstractCommand class UpdateCommand extends AbstractCommand
{ {
public function __construct()
{
$this->setName('Update command')
->setHelpMessage('Updates the SCM base code')
->setSyntaxMessage('mage update');
}
/** /**
* Updates the SCM Base Code * Updates the SCM Base Code
* @see \Mage\Command\AbstractCommand::run() * @see \Mage\Command\AbstractCommand::run()

7
Mage/Command/BuiltIn/UpgradeCommand.php

@ -20,6 +20,13 @@ use Mage\Console;
*/ */
class UpgradeCommand extends AbstractCommand class UpgradeCommand extends AbstractCommand
{ {
public function __construct()
{
$this->setName('Upgrade command')
->setHelpMessage('Upgrades Magallanes')
->setSyntaxMessage('mage upgrade');
}
/** /**
* Source for downloading * Source for downloading
* @var string * @var string

6
Mage/Command/BuiltIn/VersionCommand.php

@ -20,6 +20,12 @@ use Mage\Console;
*/ */
class VersionCommand extends AbstractCommand class VersionCommand extends AbstractCommand
{ {
public function __construct()
{
$this->setName('Version command')
->setHelpMessage('Displays the current version of Magallanes')
->setSyntaxMessage('mage version');
}
/** /**
* Display the Magallanes Version * Display the Magallanes Version
* @see \Mage\Command\AbstractCommand::run() * @see \Mage\Command\AbstractCommand::run()

15
Mage/Console.php

@ -13,6 +13,7 @@ namespace Mage;
use Mage\Command\Factory; use Mage\Command\Factory;
use Mage\Command\RequiresEnvironment; use Mage\Command\RequiresEnvironment;
use Mage\Console\Colors; use Mage\Console\Colors;
use Exception; use Exception;
use RecursiveDirectoryIterator; use RecursiveDirectoryIterator;
use SplFileInfo; use SplFileInfo;
@ -94,6 +95,7 @@ class Console
try { try {
// Load configuration // Load configuration
$config->load($arguments); $config->load($arguments);
} catch (Exception $exception) { } catch (Exception $exception) {
$configError = $exception->getMessage(); $configError = $exception->getMessage();
} }
@ -117,6 +119,7 @@ class Console
if ($showGreetings) { if ($showGreetings) {
if (!self::$logEnabled) { if (!self::$logEnabled) {
self::output('Starting <blue>Magallanes</blue>', 0, 2); self::output('Starting <blue>Magallanes</blue>', 0, 2);
} else { } else {
self::output('Starting <blue>Magallanes</blue>', 0, 1); self::output('Starting <blue>Magallanes</blue>', 0, 1);
self::log("Logging enabled"); self::log("Logging enabled");
@ -127,15 +130,20 @@ class Console
// Run Command - Check if there is a Configuration Error // Run Command - Check if there is a Configuration Error
if ($configError !== false) { if ($configError !== false) {
self::output('<red>' . $configError . '</red>', 1, 2); self::output('<red>' . $configError . '</red>', 1, 2);
} else { } else {
// Run Command and check for Command Requirements // Run Command and check for Command Requirements
try { try {
$command = Factory::get($commandName, $config); $command = Factory::get($commandName, $config);
if ($command instanceof RequiresEnvironment) { if ($config->getParameter('help')) {
if ($config->getEnvironment() === false) { self::output($command->getInfoMessage(), 2);
throw new Exception('You must specify an environment for this command.');
return 0;
} }
if ($command instanceof RequiresEnvironment && $config->getEnvironment() === false) {
throw new Exception('You must specify an environment for this command.');
} }
// Run the Command // Run the Command
@ -306,4 +314,5 @@ class Console
|| self::$config->general('verbose_logging') || self::$config->general('verbose_logging')
|| self::$config->environmentConfig('verbose_logging', false); || self::$config->environmentConfig('verbose_logging', false);
} }
} }

224
tests/MageTest/Command/AbstractCommandTest.php

@ -44,4 +44,228 @@ class AbstractCommandTest extends BaseTest
$configMock = $this->getMock('Mage\Config'); $configMock = $this->getMock('Mage\Config');
$this->doTestGetter($this->abstractCommand, 'config', $configMock); $this->doTestGetter($this->abstractCommand, 'config', $configMock);
} }
public function infoMessageProvider()
{
return array(
'happy_path' => array(
'name' => 'Example command',
'helpMessage' => 'This command does everything you want to',
'examples' => array(
array(
'snippet' => 'mage example',
'description' => 'Default command'
),
array(
'snippet' => 'mage example light',
'description' => 'Runs the command with lights'
)
),
'syntax' => 'mage example [light]',
'output' => "\n"
. "<cyan><bold>Command: </bold></cyan>Example command\n"
. "<light_blue>This command does everything you want to</light_blue>\n"
. "\n"
. "<light_gray><bold>Syntax:</bold></light_gray>\n"
. " <light_green>mage example [light]</light_green>\n"
. "\n"
. "<light_gray><bold>Usage examples:</bold></light_gray>\n"
. " * Default command:\n"
. " <green>mage example</green>\n"
. " * Runs the command with lights:\n"
. " <green>mage example light</green>\n"
),
'no_help_message' => array(
'name' => 'Example command',
'helpMessage' => '',
'examples' => array(
array(
'snippet' => 'mage example',
'description' => 'Default command'
),
array(
'snippet' => 'mage example light',
'description' => 'Runs the command with lights'
)
),
'syntax' => 'mage example [light]',
'output' => "\n"
. "<cyan><bold>Command: </bold></cyan>Example command\n"
. "<light_gray><bold>Syntax:</bold></light_gray>\n"
. " <light_green>mage example [light]</light_green>\n"
. "\n"
. "<light_gray><bold>Usage examples:</bold></light_gray>\n"
. " * Default command:\n"
. " <green>mage example</green>\n"
. " * Runs the command with lights:\n"
. " <green>mage example light</green>\n"
),
'no_examples' => array(
'name' => 'Example command',
'helpMessage' => 'This command does everything you want to',
'examples' => array(),
'syntax' => 'mage example [light]',
'output' => "\n"
. "<cyan><bold>Command: </bold></cyan>Example command\n"
. "<light_blue>This command does everything you want to</light_blue>\n"
. "\n"
. "<light_gray><bold>Syntax:</bold></light_gray>\n"
. " <light_green>mage example [light]</light_green>\n"
),
"no_syntax" => array(
'name' => 'Example command',
'helpMessage' => 'This command does everything you want to',
'examples' => array(
array(
'snippet' => 'mage example',
'description' => 'Default command'
),
array(
'snippet' => 'mage example light',
'description' => 'Runs the command with lights'
)
),
'syntax' => '',
'output' => "\n"
. "<cyan><bold>Command: </bold></cyan>Example command\n"
. "<light_blue>This command does everything you want to</light_blue>\n"
. "\n"
. "<light_gray><bold>Usage examples:</bold></light_gray>\n"
. " * Default command:\n"
. " <green>mage example</green>\n"
. " * Runs the command with lights:\n"
. " <green>mage example light</green>\n"
),
"stripping_colons" => array(
'name' => 'Example command',
'helpMessage' => 'This command does everything you want to',
'examples' => array(
array(
'snippet' => 'mage example',
'description' => 'Default command : '
),
array(
'snippet' => 'mage example light',
'description' => 'Runs the command with lights: '
)
),
'syntax' => 'mage example [light]',
'output' => "\n"
. "<cyan><bold>Command: </bold></cyan>Example command\n"
. "<light_blue>This command does everything you want to</light_blue>\n"
. "\n"
. "<light_gray><bold>Syntax:</bold></light_gray>\n"
. " <light_green>mage example [light]</light_green>\n"
. "\n"
. "<light_gray><bold>Usage examples:</bold></light_gray>\n"
. " * Default command:\n"
. " <green>mage example</green>\n"
. " * Runs the command with lights:\n"
. " <green>mage example light</green>\n"
),
"only_help" => array(
'name' => 'Example command',
'helpMessage' => 'This command does everything you want to',
'examples' => array(),
'syntax' => '',
'output' => "\n"
. "<cyan><bold>Command: </bold></cyan>Example command\n"
. "<light_blue>This command does everything you want to</light_blue>\n"
),
"only_examples" => array(
'name' => 'Example command',
'helpMessage' => '',
'examples' => array(
array(
'snippet' => 'mage example',
'description' => 'Default command'
),
array(
'snippet' => 'mage example light',
'description' => 'Runs the command with lights'
)
),
'syntax' => '',
'output' => "\n"
. "<cyan><bold>Command: </bold></cyan>Example command\n"
. "<light_gray><bold>Usage examples:</bold></light_gray>\n"
. " * Default command:\n"
. " <green>mage example</green>\n"
. " * Runs the command with lights:\n"
. " <green>mage example light</green>\n"
),
"only_syntax" => array(
'name' => 'Example command',
'helpMessage' => '',
'examples' => array(),
'syntax' => 'mage example [light]',
'output' => "\n"
. "<cyan><bold>Command: </bold></cyan>Example command\n"
. "<light_gray><bold>Syntax:</bold></light_gray>\n"
. " <light_green>mage example [light]</light_green>\n"
),
"no_name" => array(
'name' => '',
'helpMessage' => 'This command does everything you want to',
'examples' => array(
array(
'snippet' => 'mage example',
'description' => 'Default command'
),
array(
'snippet' => 'mage example light',
'description' => 'Runs the command with lights'
)
),
'syntax' => 'mage example [light]',
'output' => "\n"
. "<light_blue>This command does everything you want to</light_blue>\n"
. "\n"
. "<light_gray><bold>Syntax:</bold></light_gray>\n"
. " <light_green>mage example [light]</light_green>\n"
. "\n"
. "<light_gray><bold>Usage examples:</bold></light_gray>\n"
. " * Default command:\n"
. " <green>mage example</green>\n"
. " * Runs the command with lights:\n"
. " <green>mage example light</green>\n"
),
"no_info_at_all" => array(
'name' => '',
'helpMessage' => '',
'examples' => array(),
'syntax' => '',
'output' => "\n"
. "<red><bold>Sorry, there's no help for this command at the moment.</bold></red>\n"
)
);
}
/**
* @covers ::getInfoMessage
* @covers ::setHelpMessage
* @covers ::addUsageExample
* @covers ::setSyntaxMessage
* @covers ::setName
*
* @dataProvider infoMessageProvider
*/
public function testGetInfoMessage($name, $helpMessage, $examples, $syntax, $expectedMessage)
{
/** @var AbstractCommand $command */
$command = $this->getMockForAbstractClass('Mage\Command\AbstractCommand');
$command->setName($name);
foreach ($examples as $example) {
$command->addUsageExample($example['snippet'], $example['description']);
}
$command->setHelpMessage($helpMessage);
$command->setSyntaxMessage($syntax);
$actualMessage = $command->getInfoMessage();
$this->assertEquals($expectedMessage, $actualMessage);
}
} }

1
tests/MageTest/Command/BuiltIn/CompileCommandTest.php

@ -16,6 +16,7 @@ use malkusch\phpmock\MockBuilder;
* @uses malkusch\phpmock\MockBuilder * @uses malkusch\phpmock\MockBuilder
* @uses Mage\Console * @uses Mage\Console
* @uses Mage\Console\Colors * @uses Mage\Console\Colors
* @uses Mage\Command\AbstractCommand
*/ */
class CompileCommandTest extends BaseTest class CompileCommandTest extends BaseTest
{ {

2
tests/MageTest/Command/BuiltIn/ListCommandTest.php

@ -93,6 +93,7 @@ class ListCommandTest extends BaseTest
} }
/** /**
* @covers ::__construct
* @covers ::run * @covers ::run
* @covers ::listEnvironments * @covers ::listEnvironments
* @dataProvider listEnvironmentsProvider * @dataProvider listEnvironmentsProvider
@ -109,6 +110,7 @@ class ListCommandTest extends BaseTest
} }
/** /**
* @covers ::__construct
* @covers ::run * @covers ::run
*/ */
public function testRunWithInvalidCommand() public function testRunWithInvalidCommand()

1
tests/MageTest/Command/BuiltIn/LockCommandTest.php

@ -173,6 +173,7 @@ class LockCommandTest extends BaseTest
} }
/** /**
* @covers ::__construct
* @covers ::run * @covers ::run
* @dataProvider lockCommandProvider * @dataProvider lockCommandProvider
*/ */

1
tests/MageTest/Command/BuiltIn/UnlockCommandTest.php

@ -98,6 +98,7 @@ class UnlockCommandTest extends BaseTest
} }
/** /**
* @covers ::__construct
* @covers ::run * @covers ::run
* @dataProvider runProvider * @dataProvider runProvider
*/ */

6
tests/MageTest/Command/BuiltIn/VersionCommandTest.php

@ -8,16 +8,18 @@ use MageTest\TestHelper\BaseTest;
use PHPUnit_Framework_TestCase; use PHPUnit_Framework_TestCase;
/** /**
* @coversDefaultClass Mage\Command\BuiltIn\VersionCommands * @coversDefaultClass Mage\Command\BuiltIn\VersionCommand
* @group Mage_Command_BuildIn_VersionCommand * @group Mage_Command_BuildIn_VersionCommand
* @uses Mage\Console * @uses Mage\Console
* @uses Mage\Console\Colors * @uses Mage\Console\Colors
* @uses Mage\Command\AbstractCommand
*/ */
class VersionCommandTest extends BaseTest class VersionCommandTest extends BaseTest
{ {
/** /**
* @group 175 * @group 175
* @covers Mage\Command\BuiltIn\VersionCommand::run() * @covers ::__construct
* @covers ::run()
*/ */
public function testRun() public function testRun()
{ {

Loading…
Cancel
Save