1
+ # split into multiple files and add missing scenarios (like run with parameters)
1
2
Feature : Describing a controller
2
3
As a Developer
3
4
I want to automate creating controller specifications
@@ -6,13 +7,14 @@ Feature: Describing a controller
6
7
Background :
7
8
Given the Symfony extension is enabled
8
9
10
+ @wip
9
11
Scenario Outline : Controller spec is generated
10
12
When I describe the "<class>"
11
- Then a new specification should be generated in the "spec/ Scenario1/Bundle/DemoBundle/Controller/UserControllerSpec.php" :
13
+ Then a new specification should be generated in the "Scenario1/Bundle/DemoBundle/Spec /Controller/UserControllerSpec.php" :
12
14
"""
13
15
<?php
14
16
15
- namespace spec\ Scenario1\Bundle\DemoBundle\Controller;
17
+ namespace Scenario1\Bundle\DemoBundle\Spec \Controller;
16
18
17
19
use PhpSpec\Symfony2Extension\Specification\ControllerBehavior;
18
20
use Prophecy\Argument;
@@ -21,7 +23,7 @@ Feature: Describing a controller
21
23
{
22
24
function it_is_initializable()
23
25
{
24
- $this->shouldHaveType('Scenario1\Bundle\DemoBundle\Controller\UserController');
26
+ $this->shouldHaveType('Scenario1\Bundle\DemoBundle\Spec\ Controller\UserController');
25
27
}
26
28
}
27
29
@@ -30,34 +32,9 @@ Feature: Describing a controller
30
32
Examples :
31
33
| class |
32
34
| Scenario1 /Bundle /DemoBundle /Controller /UserController |
33
- | spec /Scenario1 /Bundle /DemoBundle /Controller /UserController |
34
-
35
- Scenario : Non-controller spec is generated with a default template
36
- When I describe the "Scenario2/Bundle/DemoBundle/User"
37
- Then a new specification should be generated in the "spec/Scenario2/Bundle/DemoBundle/UserSpec.php" :
38
- """
39
- <?php
40
-
41
- namespace spec\Scenario2\Bundle\DemoBundle;
42
-
43
- use PhpSpec\ObjectBehavior;
44
- use Prophecy\Argument;
45
-
46
- class UserSpec extends ObjectBehavior
47
- {
48
- function it_is_initializable()
49
- {
50
- $this->shouldHaveType('Scenario2\Bundle\DemoBundle\User');
51
- }
52
- }
53
-
54
- """
55
-
56
- Scenario : Running a controller spec
57
- Given I described the "Scenario3/Bundle/DemoBundle/Controller/UserController"
58
- When I run phpspec
59
- Then I should see "class Scenario3\B undle\D emoBundle\C ontroller\U serController does not exist"
35
+ | Scenario1 /Bundle /DemoBundle /Spec /Controller /UserController |
60
36
37
+ @wip
61
38
Scenario : Generating a controller
62
39
Given I described the "Scenario4/Bundle/DemoBundle/Controller/UserController"
63
40
When I run phpspec and answer "y" to the first question
@@ -75,12 +52,13 @@ Feature: Describing a controller
75
52
76
53
"""
77
54
78
- Scenario : Executing a controller spec with response inspection
79
- Given I wrote a spec in the "spec/Scenario5/Bundle/DemoBundle/Controller/UserControllerSpec.php" :
55
+ @wip
56
+ Scenario : Executing a controller spec with a response inspection
57
+ Given I wrote a spec in the "Scenario5/Bundle/DemoBundle/Spec/Controller/UserControllerSpec.php" :
80
58
"""
81
59
<?php
82
60
83
- namespace spec\ Scenario5\Bundle\DemoBundle\Controller;
61
+ namespace Scenario5\Bundle\DemoBundle\Spec \Controller;
84
62
85
63
use PhpSpec\Symfony2Extension\Specification\ControllerBehavior;
86
64
use Prophecy\Argument;
@@ -117,12 +95,13 @@ Feature: Describing a controller
117
95
When I run phpspec
118
96
Then I should see "1 example (1 passed)"
119
97
98
+ @wip
120
99
Scenario : Executing a controller spec with a service
121
- Given I wrote a spec in the "spec/ Scenario6/Bundle/DemoBundle/Controller/UserControllerSpec.php" :
100
+ Given I wrote a spec in the "Scenario6/Bundle/DemoBundle/Spec /Controller/UserControllerSpec.php" :
122
101
"""
123
102
<?php
124
103
125
- namespace spec\ Scenario6\Bundle\DemoBundle\Controller;
104
+ namespace Scenario6\Bundle\DemoBundle\Spec \Controller;
126
105
127
106
use PhpSpec\Symfony2Extension\Specification\ControllerBehavior;
128
107
use Prophecy\Argument;
@@ -167,12 +146,12 @@ Feature: Describing a controller
167
146
Then I should see "1 example (1 passed)"
168
147
169
148
@wip
170
- Scenario : Executing a controller spec with render matcher
171
- Given I wrote a spec in the "spec/ Scenario7/Bundle/DemoBundle/Controller/UserControllerSpec.php" :
149
+ Scenario : Executing a controller spec with a render matcher
150
+ Given I wrote a spec in the "Scenario7/Bundle/DemoBundle/Spec /Controller/UserControllerSpec.php" :
172
151
"""
173
152
<?php
174
153
175
- namespace spec\ Scenario7\Bundle\DemoBundle\Controller;
154
+ namespace Scenario7\Bundle\DemoBundle\Spec \Controller;
176
155
177
156
use PhpSpec\Symfony2Extension\Specification\ControllerBehavior;
178
157
use Prophecy\Argument;
0 commit comments