File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ We are now ready to write our first test::
8989
9090 private function getFrameworkForException($exception)
9191 {
92- $matcher = $this->getMock ('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
92+ $matcher = $this->createMock ('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
9393 $matcher
9494 ->expects($this->once())
9595 ->method('match')
@@ -98,9 +98,9 @@ We are now ready to write our first test::
9898 $matcher
9999 ->expects($this->once())
100100 ->method('getContext')
101- ->will($this->returnValue($this->getMock ('Symfony\Component\Routing\RequestContext')))
101+ ->will($this->returnValue($this->createMock ('Symfony\Component\Routing\RequestContext')))
102102 ;
103- $resolver = $this->getMock ('Symfony\Component\HttpKernel\Controller\ControllerResolverInterface');
103+ $resolver = $this->createMock ('Symfony\Component\HttpKernel\Controller\ControllerResolverInterface');
104104
105105 return new Framework($matcher, $resolver);
106106 }
@@ -144,7 +144,7 @@ Response::
144144
145145 public function testControllerResponse()
146146 {
147- $matcher = $this->getMock ('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
147+ $matcher = $this->createMock ('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
148148 $matcher
149149 ->expects($this->once())
150150 ->method('match')
@@ -159,7 +159,7 @@ Response::
159159 $matcher
160160 ->expects($this->once())
161161 ->method('getContext')
162- ->will($this->returnValue($this->getMock ('Symfony\Component\Routing\RequestContext')))
162+ ->will($this->returnValue($this->createMock ('Symfony\Component\Routing\RequestContext')))
163163 ;
164164 $resolver = new ControllerResolver();
165165
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ allows you to return a list of extensions to register::
185185 {
186186 protected function getExtensions()
187187 {
188- $validator = $this->getMock ('\Symfony\Component\Validator\Validator\ValidatorInterface');
188+ $validator = $this->createMock ('\Symfony\Component\Validator\Validator\ValidatorInterface');
189189 $validator->method('validate')->will($this->returnValue(new ConstraintViolationList()));
190190
191191 return array(
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ it's easy to pass a mock object within a test::
6666 public function testCalculateTotalSalary()
6767 {
6868 // First, mock the object to be used in the test
69- $employee = $this->getMock ('\AppBundle\Entity\Employee');
69+ $employee = $this->createMock ('\AppBundle\Entity\Employee');
7070 $employee->expects($this->once())
7171 ->method('getSalary')
7272 ->will($this->returnValue(1000));
You can’t perform that action at this time.
0 commit comments