File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ We are now ready to write our first test::
93
93
private function getFrameworkForException($exception)
94
94
{
95
95
$matcher = $this->createMock(Routing\Matcher\UrlMatcherInterface::class);
96
+ // use getMock() on PHPUnit 5.3 or below
97
+ // $matcher = $this->getMock(Routing\Matcher\UrlMatcherInterface::class);
98
+
96
99
$matcher
97
100
->expects($this->once())
98
101
->method('match')
@@ -149,6 +152,9 @@ Response::
149
152
public function testControllerResponse()
150
153
{
151
154
$matcher = $this->createMock(Routing\Matcher\UrlMatcherInterface::class);
155
+ // use getMock() on PHPUnit 5.3 or below
156
+ // $matcher = $this->getMock(Routing\Matcher\UrlMatcherInterface::class);
157
+
152
158
$matcher
153
159
->expects($this->once())
154
160
->method('match')
Original file line number Diff line number Diff line change @@ -185,6 +185,8 @@ allows you to return a list of extensions to register::
185
185
protected function getExtensions()
186
186
{
187
187
$validator = $this->createMock(ValidatorInterface::class);
188
+ // use getMock() on PHPUnit 5.3 or below
189
+ // $validator = $this->getMock(ValidatorInterface::class);
188
190
$validator
189
191
->method('validate')
190
192
->will($this->returnValue(new ConstraintViolationList()));
Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ it's easy to pass a mock object within a test::
71
71
{
72
72
// First, mock the object to be used in the test
73
73
$employee = $this->createMock(Employee::class);
74
+ // use getMock() on PHPUnit 5.3 or below
75
+ // $employee = $this->getMock(Employee::class);
74
76
$employee->expects($this->once())
75
77
->method('getSalary')
76
78
->will($this->returnValue(1000));
You can’t perform that action at this time.
0 commit comments