Skip to content

Commit 420c26b

Browse files
committed
Create architecture
1 parent 3fc6456 commit 420c26b

File tree

7 files changed

+98
-1
lines changed

7 files changed

+98
-1
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
/vendor/
1+
bin
2+
vendor
23
composer.lock

composer.json

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
"require": {
44
"phpspec/phpspec": "~2.0"
55
},
6+
"config": {
7+
"bin-dir": "bin"
8+
},
9+
"autoload": {
10+
"psr-0": {
11+
"Knp\\PhpSpec\\WellDone": "src/"
12+
}
13+
},
614
"license": "MIT",
715
"authors": [
816
{

phpspec.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
extensions:
2+
- Knp\PhpSpec\WellDone\Extension
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
}
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
}

0 commit comments

Comments
 (0)