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::
9393 private function getFrameworkForException($exception)
9494 {
9595 $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+
9699 $matcher
97100 ->expects($this->once())
98101 ->method('match')
@@ -149,6 +152,9 @@ Response::
149152 public function testControllerResponse()
150153 {
151154 $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+
152158 $matcher
153159 ->expects($this->once())
154160 ->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::
185185 protected function getExtensions()
186186 {
187187 $validator = $this->createMock(ValidatorInterface::class);
188+ // use getMock() on PHPUnit 5.3 or below
189+ // $validator = $this->getMock(ValidatorInterface::class);
188190 $validator
189191 ->method('validate')
190192 ->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::
7171 {
7272 // First, mock the object to be used in the test
7373 $employee = $this->createMock(Employee::class);
74+ // use getMock() on PHPUnit 5.3 or below
75+ // $employee = $this->getMock(Employee::class);
7476 $employee->expects($this->once())
7577 ->method('getSalary')
7678 ->will($this->returnValue(1000));
You can’t perform that action at this time.
0 commit comments