diff --git a/create_framework/unit-testing.rst b/create_framework/unit-testing.rst index b34b3a76e2d..90ab5a32868 100644 --- a/create_framework/unit-testing.rst +++ b/create_framework/unit-testing.rst @@ -91,6 +91,12 @@ We are now ready to write our first test:: protected function getFrameworkForException($exception) { $matcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface'); + $context = $this->getMock('Symfony\Component\Routing\RequestContext'); + $matcher + ->expects($this->once()) + ->method('getContext') + ->willReturn($context) + ; $matcher ->expects($this->once()) ->method('match') @@ -141,6 +147,12 @@ Response:: public function testControllerResponse() { $matcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface'); + $context = $this->getMock('Symfony\Component\Routing\RequestContext'); + $matcher + ->expects($this->once()) + ->method('getContext') + ->willReturn($context) + ; $matcher ->expects($this->once()) ->method('match')