@@ -21,22 +21,22 @@ Then, create a PHPUnit configuration file in ``example.com/phpunit.xml.dist``:
21
21
<?xml version =" 1.0" encoding =" UTF-8" ?>
22
22
<phpunit
23
23
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
24
- xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10.4 /phpunit.xsd"
24
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3 /phpunit.xsd"
25
25
backupGlobals =" false"
26
26
colors =" true"
27
27
bootstrap =" vendor/autoload.php"
28
28
>
29
- <coverage />
29
+ <coverage processUncoveredFiles =" true" >
30
+ <include >
31
+ <directory suffix =" .php" >./src</directory >
32
+ </include >
33
+ </coverage >
34
+
30
35
<testsuites >
31
36
<testsuite name =" Test Suite" >
32
37
<directory >./tests</directory >
33
38
</testsuite >
34
39
</testsuites >
35
- <source >
36
- <include >
37
- <directory suffix =" .php" >./src</directory >
38
- </include >
39
- </source >
40
40
</phpunit >
41
41
42
42
This configuration defines sensible defaults for most PHPUnit settings; more
@@ -114,7 +114,7 @@ We are now ready to write our first test::
114
114
$matcher
115
115
->expects($this->once())
116
116
->method('getContext')
117
- ->willReturn ($this->createMock(Routing\RequestContext::class))
117
+ ->will ($this->retunValue($this-> createMock(Routing\RequestContext::class) ))
118
118
;
119
119
$controllerResolver = $this->createMock(ControllerResolverInterface::class);
120
120
$argumentResolver = $this->createMock(ArgumentResolverInterface::class);
@@ -169,16 +169,16 @@ Response::
169
169
$matcher
170
170
->expects($this->once())
171
171
->method('match')
172
- ->willReturn ([
172
+ ->will($this->returnValue ([
173
173
'_route' => 'is_leap_year/{year}',
174
174
'year' => '2000',
175
175
'_controller' => [new LeapYearController(), 'index'],
176
- ])
176
+ ]));
177
177
;
178
178
$matcher
179
179
->expects($this->once())
180
180
->method('getContext')
181
- ->willReturn ($this->createMock(Routing\RequestContext::class))
181
+ ->will ($this->returnValue($this-> createMock(Routing\RequestContext::class) ))
182
182
;
183
183
$controllerResolver = new ControllerResolver();
184
184
$argumentResolver = new ArgumentResolver();
0 commit comments