Commit b10ec528 authored by Fabien Potencier's avatar Fabien Potencier

removed usage of obsolete PHPUnit method

parent e6dd62a3
......@@ -478,7 +478,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testRegisterShouldReturnSelf()
{
$app = new Application();
$provider = $this->getMock('Silex\ServiceProviderInterface');
$provider = $this->getMockBuilder('Silex\ServiceProviderInterface')->getMock();
$this->assertSame($app, $app->register($provider));
}
......
......@@ -31,7 +31,7 @@ class LogListenerTest extends \PHPUnit_Framework_TestCase
{
public function testRequestListener()
{
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
$logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
$logger
->expects($this->once())
->method('info')
......@@ -41,7 +41,7 @@ class LogListenerTest extends \PHPUnit_Framework_TestCase
$dispatcher = new EventDispatcher();
$dispatcher->addSubscriber(new LogListener($logger));
$kernel = $this->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface');
$kernel = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernelInterface')->getMock();
$dispatcher->dispatch(KernelEvents::REQUEST, new GetResponseEvent($kernel, Request::create('/subrequest'), HttpKernelInterface::SUB_REQUEST), 'Skip sub requests');
......@@ -50,7 +50,7 @@ class LogListenerTest extends \PHPUnit_Framework_TestCase
public function testResponseListener()
{
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
$logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
$logger
->expects($this->once())
->method('info')
......@@ -60,7 +60,7 @@ class LogListenerTest extends \PHPUnit_Framework_TestCase
$dispatcher = new EventDispatcher();
$dispatcher->addSubscriber(new LogListener($logger));
$kernel = $this->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface');
$kernel = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernelInterface')->getMock();
$dispatcher->dispatch(KernelEvents::RESPONSE, new FilterResponseEvent($kernel, Request::create('/foo'), HttpKernelInterface::SUB_REQUEST, Response::create('subrequest', 200)), 'Skip sub requests');
......@@ -69,7 +69,7 @@ class LogListenerTest extends \PHPUnit_Framework_TestCase
public function testExceptionListener()
{
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
$logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
$logger
->expects($this->once())
->method('critical')
......@@ -85,7 +85,7 @@ class LogListenerTest extends \PHPUnit_Framework_TestCase
$dispatcher = new EventDispatcher();
$dispatcher->addSubscriber(new LogListener($logger));
$kernel = $this->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface');
$kernel = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernelInterface')->getMock();
$dispatcher->dispatch(KernelEvents::EXCEPTION, new GetResponseForExceptionEvent($kernel, Request::create('/foo'), HttpKernelInterface::SUB_REQUEST, new \RuntimeException('Fatal error')));
......
......@@ -26,7 +26,7 @@ class LazyUrlMatcherTest extends \PHPUnit_Framework_TestCase
public function testUserMatcherIsCreatedLazily()
{
$callCounter = 0;
$urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
$urlMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\UrlMatcherInterface')->getMock();
$matcher = new LazyUrlMatcher(function () use ($urlMatcher, &$callCounter) {
++$callCounter;
......@@ -57,7 +57,7 @@ class LazyUrlMatcherTest extends \PHPUnit_Framework_TestCase
*/
public function testMatchIsProxy()
{
$urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
$urlMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\UrlMatcherInterface')->getMock();
$urlMatcher->expects($this->once())
->method('match')
->with('path')
......@@ -76,8 +76,8 @@ class LazyUrlMatcherTest extends \PHPUnit_Framework_TestCase
*/
public function testSetContextIsProxy()
{
$context = $this->getMock('Symfony\Component\Routing\RequestContext');
$urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
$context = $this->getMockBuilder('Symfony\Component\Routing\RequestContext')->getMock();
$urlMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\UrlMatcherInterface')->getMock();
$urlMatcher->expects($this->once())
->method('setContext')
->with($context);
......@@ -93,8 +93,8 @@ class LazyUrlMatcherTest extends \PHPUnit_Framework_TestCase
*/
public function testGetContextIsProxy()
{
$context = $this->getMock('Symfony\Component\Routing\RequestContext');
$urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
$context = $this->getMockBuilder('Symfony\Component\Routing\RequestContext')->getMock();
$urlMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\UrlMatcherInterface')->getMock();
$urlMatcher->expects($this->once())
->method('getContext')
->will($this->returnValue($context));
......
......@@ -75,7 +75,7 @@ class TwigServiceProviderTest extends \PHPUnit_Framework_TestCase
$app->register(new TwigServiceProvider(), array(
'twig.templates' => array('foo' => 'foo'),
));
$loader = $this->getMock('\Twig_LoaderInterface');
$loader = $this->getMockBuilder('\Twig_LoaderInterface')->getMock();
$loader->expects($this->never())->method('getSource');
$app['twig.loader.filesystem'] = $app->share(function ($app) use ($loader) {
return $loader;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment