|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* MageSpec |
|
4
|
|
|
* |
|
5
|
|
|
* NOTICE OF LICENSE |
|
6
|
|
|
* |
|
7
|
|
|
* This source file is subject to the MIT License, that is bundled with this |
|
8
|
|
|
* package in the file LICENSE. |
|
9
|
|
|
* It is also available through the world-wide-web at this URL: |
|
10
|
|
|
* |
|
11
|
|
|
* http://opensource.org/licenses/MIT |
|
12
|
|
|
* |
|
13
|
|
|
* If you did not receive a copy of the license and are unable to obtain it |
|
14
|
|
|
* through the world-wide-web, please send an email |
|
15
|
|
|
* to <[email protected]> so we can send you a copy immediately. |
|
16
|
|
|
* |
|
17
|
|
|
* @category MageTest |
|
18
|
|
|
* @package PhpSpec_MagentoExtension |
|
19
|
|
|
* |
|
20
|
|
|
* @copyright Copyright (c) 2012-2013 MageTest team and contributors. |
|
21
|
|
|
*/ |
|
22
|
|
|
namespace MageTest\PhpSpec\MagentoExtension\Console\Command; |
|
23
|
|
|
|
|
24
|
|
|
use Symfony\Component\Console\Input\InputArgument; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* DescribeControllerCommand |
|
28
|
|
|
* |
|
29
|
|
|
* @category MageTest |
|
30
|
|
|
* @package PhpSpec_MagentoExtension |
|
31
|
|
|
* |
|
32
|
|
|
* @author MageTest team (https://github.com/MageTest/MageSpec/contributors) |
|
33
|
|
|
*/ |
|
34
|
|
|
class DescribeControllerCommand extends MageCommand |
|
35
|
|
|
{ |
|
36
|
|
|
/** |
|
37
|
|
|
* @var string |
|
38
|
|
|
*/ |
|
39
|
|
|
protected $validator = '/^([a-zA-Z0-9]+)_([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)$/'; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @var string |
|
43
|
|
|
*/ |
|
44
|
|
|
protected $help = <<<HELP |
|
45
|
|
|
The controller alias provided doesn't follow the Magento naming conventions. |
|
46
|
|
|
Please make sure it looks like the following: |
|
47
|
|
|
|
|
48
|
|
|
vendorname_modulename/controllername |
|
49
|
|
|
|
|
50
|
|
|
The lowercase convention is used because it reflects the best practice |
|
51
|
|
|
convention within the Magento community. This reflects the identifier that |
|
52
|
|
|
you would pass to the router in config.xml. |
|
53
|
|
|
HELP; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @var string |
|
57
|
|
|
*/ |
|
58
|
|
|
protected $type = 'controller'; |
|
59
|
|
|
|
|
60
|
|
|
protected function configure() |
|
61
|
|
|
{ |
|
62
|
|
|
$this->setName('describe:controller') |
|
63
|
|
|
->setDescription('Describe a Magento Controller specification') |
|
64
|
|
|
->addArgument('alias', InputArgument::REQUIRED, 'Magento Controller alias to be described'); |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|