Skip to content

Commit 3e4a635

Browse files
committed
back to phpunit9
1 parent 1cf73de commit 3e4a635

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

create_framework/unit_testing.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ Then, create a PHPUnit configuration file in ``example.com/phpunit.xml.dist``:
2121
<?xml version="1.0" encoding="UTF-8"?>
2222
<phpunit
2323
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"
2525
backupGlobals="false"
2626
colors="true"
2727
bootstrap="vendor/autoload.php"
2828
>
29-
<coverage/>
29+
<coverage processUncoveredFiles="true">
30+
<include>
31+
<directory suffix=".php">./src</directory>
32+
</include>
33+
</coverage>
34+
3035
<testsuites>
3136
<testsuite name="Test Suite">
3237
<directory>./tests</directory>
3338
</testsuite>
3439
</testsuites>
35-
<source>
36-
<include>
37-
<directory suffix=".php">./src</directory>
38-
</include>
39-
</source>
4040
</phpunit>
4141
4242
This configuration defines sensible defaults for most PHPUnit settings; more
@@ -114,7 +114,7 @@ We are now ready to write our first test::
114114
$matcher
115115
->expects($this->once())
116116
->method('getContext')
117-
->willReturn($this->createMock(Routing\RequestContext::class))
117+
->will($this->retunValue($this->createMock(Routing\RequestContext::class)))
118118
;
119119
$controllerResolver = $this->createMock(ControllerResolverInterface::class);
120120
$argumentResolver = $this->createMock(ArgumentResolverInterface::class);
@@ -169,16 +169,16 @@ Response::
169169
$matcher
170170
->expects($this->once())
171171
->method('match')
172-
->willReturn([
172+
->will($this->returnValue([
173173
'_route' => 'is_leap_year/{year}',
174174
'year' => '2000',
175175
'_controller' => [new LeapYearController(), 'index'],
176-
])
176+
]));
177177
;
178178
$matcher
179179
->expects($this->once())
180180
->method('getContext')
181-
->willReturn($this->createMock(Routing\RequestContext::class))
181+
->will($this->returnValue($this->createMock(Routing\RequestContext::class)))
182182
;
183183
$controllerResolver = new ControllerResolver();
184184
$argumentResolver = new ArgumentResolver();

0 commit comments

Comments
 (0)