@@ -49,7 +49,8 @@ resolver. Modify the framework to make use of them::
49
49
namespace Simplex;
50
50
51
51
// ...
52
-
52
+
53
+ use Calendar\Controller\LeapYearController;
53
54
use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
54
55
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
55
56
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
@@ -125,7 +126,7 @@ Execute this test by running ``phpunit`` in the ``example.com`` directory:
125
126
126
127
.. code-block :: terminal
127
128
128
- $ phpunit
129
+ $ ./vendor/bin/ phpunit
129
130
130
131
.. note ::
131
132
@@ -164,11 +1
8000
65,9 @@ Response::
164
165
->expects($this->once())
165
166
->method('match')
166
167
->will($this->returnValue([
167
- '_route' => 'foo',
168
- 'name' => 'Fabien',
169
- '_controller' => function ($name) {
170
- return new Response('Hello '.$name);
171
- }
168
+ '_route' => 'is_leap_year/{year}',
169
+ 'year' => '2000',
170
+ '_controller' => [new LeapYearController(), 'index']
172
171
]))
173
172
;
174
173
$matcher
@@ -196,7 +195,7 @@ coverage feature (you need to enable `XDebug`_ first):
196
195
197
196
.. code-block :: terminal
198
197
199
- $ phpunit --coverage-html=cov/
198
+ $ ./vendor/bin/ phpunit --coverage-html=cov/
200
199
201
200
Open ``example.com/cov/src/Simplex/Framework.php.html `` in a browser and check
202
201
that all the lines for the Framework class are green (it means that they have
@@ -206,7 +205,7 @@ Alternatively you can output the result directly to the console:
206
205
207
206
.. code-block :: terminal
208
207
209
- $ phpunit --coverage-text
208
+ $ ./vendor/bin/ phpunit --coverage-text
210
209
211
210
Thanks to the clean object-oriented code that we have written so far, we have
212
211
been able to write unit-tests to cover all possible use cases of our
0 commit comments