File tree 7 files changed +98
-1
lines changed
spec/Knp/PhpSpec/WellDone
7 files changed +98
-1
lines changed Original file line number Diff line number Diff line change 1
- /vendor /
1
+ bin
2
+ vendor
2
3
composer.lock
Original file line number Diff line number Diff line change 3
3
"require" : {
4
4
"phpspec/phpspec" : " ~2.0"
5
5
},
6
+ "config" : {
7
+ "bin-dir" : " bin"
8
+ },
9
+ "autoload" : {
10
+ "psr-0" : {
11
+ "Knp\\ PhpSpec\\ WellDone" : " src/"
12
+ }
13
+ },
6
14
"license" : " MIT" ,
7
15
"authors" : [
8
16
{
Original file line number Diff line number Diff line change
1
+ extensions :
2
+ - Knp\PhpSpec\WellDone\Extension
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace spec \Knp \PhpSpec \WellDone \Console \Command ;
4
+
5
+ use PhpSpec \ObjectBehavior ;
6
+ use Prophecy \Argument ;
7
+
8
+ class StatusCommandSpec extends ObjectBehavior
9
+ {
10
+ function it_is_initializable ()
11
+ {
12
+ $ this ->shouldHaveType ('Knp\PhpSpec\WellDone\Console\Command\StatusCommand ' );
13
+ }
14
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace spec \Knp \PhpSpec \WellDone ;
4
+
5
+ use PhpSpec \ObjectBehavior ;
6
+ use Prophecy \Argument ;
7
+
8
+ class ExtensionSpec extends ObjectBehavior
9
+ {
10
+ function it_is_initializable ()
11
+ {
12
+ $ this ->shouldHaveType ('Knp\PhpSpec\WellDone\Extension ' );
13
+ }
14
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Knp \PhpSpec \WellDone \Console \Command ;
4
+
5
+ use Symfony \Component \Console \Command \Command ;
6
+ use Symfony \Component \Console \Input \InputInterface ;
7
+ use Symfony \Component \Console \Output \OutputInterface ;
8
+
9
+ class StatusCommand extends Command
10
+ {
11
+ public function __construct ()
12
+ {
13
+ parent ::__construct ('status ' );
14
+
15
+ $ this ->setDefinition (array ());
16
+ }
17
+
18
+ protected function execute (InputInterface $ input , OutputInterface $ output )
19
+ {
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Knp \PhpSpec \WellDone ;
4
+
5
+ use PhpSpec \Extension \ExtensionInterface ;
6
+ use PhpSpec \ServiceContainer ;
7
+ use Symfony \Component \Config \FileLocator ;
8
+ use Symfony \Component \Console \Input \InputArgument ;
9
+ use Symfony \Component \DependencyInjection \Loader \YamlFileLoader ;
10
+
11
+ class Extension implements ExtensionInterface
12
+ {
13
+ public function load (ServiceContainer $ container )
14
+ {
15
+ $ this ->setupConsole ($ container );
16
+ $ this ->setupCommands ($ container );
17
+ }
18
+
19
+ protected function setupConsole (ServiceContainer $ container )
20
+ {
21
+ $ definition = $ container ->get ('console.commands.run ' )->getDefinition ();
22
+ $ definition ->addArgument (
23
+ new InputArgument (
24
+ 'status ' ,
25
+ InputArgument::OPTIONAL ,
26
+ 'Display global status of specifications '
27
+ )
28
+ );
29
+ }
30
+
31
+ protected function setupCommands (ServiceContainer $ container )
32
+ {
33
+ $ container ->setShared ('console.commands.status ' , function ($ c ) {
34
+ return new Console \Command \StatusCommand ;
35
+ });
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments