diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-07-10 14:17:26 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-07-11 08:50:07 +0200 |
commit | 2fa9e672940012bfff5c3763d573158960416372 (patch) | |
tree | 558f3acefa54f5fc5303e3320795ac6855e2c0a7 /tests/lib/AppFramework/Http/DispatcherTest.php | |
parent | 67278d12e1f572d390722935f0eeb9aed34b708c (diff) | |
download | nextcloud-server-2fa9e672940012bfff5c3763d573158960416372.tar.gz nextcloud-server-2fa9e672940012bfff5c3763d573158960416372.zip |
Fix phpunit-5.4 wargning
* getMock is deprecated.
* \PDOStatement mocking fails hard on phpunit 4.8
Diffstat (limited to 'tests/lib/AppFramework/Http/DispatcherTest.php')
-rw-r--r-- | tests/lib/AppFramework/Http/DispatcherTest.php | 56 |
1 files changed, 41 insertions, 15 deletions
diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php index 6df6f7fa7fe..c2d73adfd7b 100644 --- a/tests/lib/AppFramework/Http/DispatcherTest.php +++ b/tests/lib/AppFramework/Http/DispatcherTest.php @@ -105,9 +105,11 @@ class DispatcherTest extends \Test\TestCase { '\OC\AppFramework\Middleware\MiddlewareDispatcher') ->disableOriginalConstructor() ->getMock(); - $this->controller = $this->getMock( - '\OCP\AppFramework\Controller', - array($this->controllerMethod), array($app, $request)); + $this->controller = $this->getMockBuilder( + '\OCP\AppFramework\Controller') + ->setMethods([$this->controllerMethod]) + ->setConstructorArgs([$app, $request]) + ->getMock(); $this->request = $this->getMockBuilder( '\OC\AppFramework\Http\Request') @@ -296,8 +298,12 @@ class DispatcherTest extends \Test\TestCase { ], 'method' => 'POST' ], - $this->getMock('\OCP\Security\ISecureRandom'), - $this->getMock('\OCP\IConfig') + $this->getMockBuilder('\OCP\Security\ISecureRandom') + ->disableOriginalConstructor() + ->getMock(), + $this->getMockBuilder('\OCP\IConfig') + ->disableOriginalConstructor() + ->getMock() ); $this->dispatcher = new Dispatcher( $this->http, $this->middlewareDispatcher, $this->reflector, @@ -323,8 +329,12 @@ class DispatcherTest extends \Test\TestCase { ], 'method' => 'POST', ], - $this->getMock('\OCP\Security\ISecureRandom'), - $this->getMock('\OCP\IConfig') + $this->getMockBuilder('\OCP\Security\ISecureRandom') + ->disableOriginalConstructor() + ->getMock(), + $this->getMockBuilder('\OCP\IConfig') + ->disableOriginalConstructor() + ->getMock() ); $this->dispatcher = new Dispatcher( $this->http, $this->middlewareDispatcher, $this->reflector, @@ -353,8 +363,12 @@ class DispatcherTest extends \Test\TestCase { ], 'method' => 'GET' ], - $this->getMock('\OCP\Security\ISecureRandom'), - $this->getMock('\OCP\IConfig') + $this->getMockBuilder('\OCP\Security\ISecureRandom') + ->disableOriginalConstructor() + ->getMock(), + $this->getMockBuilder('\OCP\IConfig') + ->disableOriginalConstructor() + ->getMock() ); $this->dispatcher = new Dispatcher( $this->http, $this->middlewareDispatcher, $this->reflector, @@ -382,8 +396,12 @@ class DispatcherTest extends \Test\TestCase { ], 'method' => 'GET' ], - $this->getMock('\OCP\Security\ISecureRandom'), - $this->getMock('\OCP\IConfig') + $this->getMockBuilder('\OCP\Security\ISecureRandom') + ->disableOriginalConstructor() + ->getMock(), + $this->getMockBuilder('\OCP\IConfig') + ->disableOriginalConstructor() + ->getMock() ); $this->dispatcher = new Dispatcher( $this->http, $this->middlewareDispatcher, $this->reflector, @@ -412,8 +430,12 @@ class DispatcherTest extends \Test\TestCase { ], 'method' => 'PUT' ], - $this->getMock('\OCP\Security\ISecureRandom'), - $this->getMock('\OCP\IConfig') + $this->getMockBuilder('\OCP\Security\ISecureRandom') + ->disableOriginalConstructor() + ->getMock(), + $this->getMockBuilder('\OCP\IConfig') + ->disableOriginalConstructor() + ->getMock() ); $this->dispatcher = new Dispatcher( $this->http, $this->middlewareDispatcher, $this->reflector, @@ -444,8 +466,12 @@ class DispatcherTest extends \Test\TestCase { ], 'method' => 'POST' ], - $this->getMock('\OCP\Security\ISecureRandom'), - $this->getMock('\OCP\IConfig') + $this->getMockBuilder('\OCP\Security\ISecureRandom') + ->disableOriginalConstructor() + ->getMock(), + $this->getMockBuilder('\OCP\IConfig') + ->disableOriginalConstructor() + ->getMock() ); $this->dispatcher = new Dispatcher( $this->http, $this->middlewareDispatcher, $this->reflector, |