From 5c1b5e03ea977e9d9136b88cf905eca1f4a44ef5 Mon Sep 17 00:00:00 2001 From: emillosanti Date: Sun, 5 Jul 2015 20:44:05 +0800 Subject: [PATCH] resolve #5487 [create_framework] phpunit test error #5487 Call to a member function fromRequest() on a non-object in .../src/Simplex/Framework.php on line 29 --- create_framework/unit-testing.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/create_framework/unit-testing.rst b/create_framework/unit-testing.rst index 7bccdceb4bd..8fa4bd000c9 100644 --- a/create_framework/unit-testing.rst +++ b/create_framework/unit-testing.rst @@ -96,6 +96,11 @@ We are now ready to write our first test:: ->method('match') ->will($this->throwException($exception)) ; + $matcher + ->expects($this->once()) + ->method('getContext') + ->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext'))) + ; $resolver = $this->getMock('Symfony\Component\HttpKernel\Controller\ControllerResolverInterface'); return new Framework($matcher, $resolver);