summaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/DependencyInjection
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-07-10 14:17:26 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-07-11 08:50:07 +0200
commit2fa9e672940012bfff5c3763d573158960416372 (patch)
tree558f3acefa54f5fc5303e3320795ac6855e2c0a7 /tests/lib/AppFramework/DependencyInjection
parent67278d12e1f572d390722935f0eeb9aed34b708c (diff)
downloadnextcloud-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/DependencyInjection')
-rw-r--r--tests/lib/AppFramework/DependencyInjection/DIContainerTest.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php
index 5aa000fa25a..0edf96dd5a4 100644
--- a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php
+++ b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php
@@ -36,10 +36,13 @@ class DIContainerTest extends \Test\TestCase {
protected function setUp(){
parent::setUp();
- $this->container = $this->getMock('OC\AppFramework\DependencyInjection\DIContainer',
- ['isAdminUser'], ['name']
- );
- $this->api = $this->getMock('OC\AppFramework\Core\API', array(), array('hi'));
+ $this->container = $this->getMockBuilder('OC\AppFramework\DependencyInjection\DIContainer')
+ ->setMethods(['isAdminUser'])
+ ->setConstructorArgs(['name'])
+ ->getMock();
+ $this->api = $this->getMockBuilder('OC\AppFramework\Core\API')
+ ->setConstructorArgs(['hi'])
+ ->getMock();
}
public function testProvidesAPI(){
@@ -75,8 +78,12 @@ class DIContainerTest extends \Test\TestCase {
public function testMiddlewareDispatcherIncludesSecurityMiddleware(){
$this->container['Request'] = new Request(
['method' => 'GET'],
- $this->getMock('\OCP\Security\ISecureRandom'),
- $this->getMock('\OCP\IConfig')
+ $this->getMockBuilder('\OCP\Security\ISecureRandom')
+ ->disableOriginalConstructor()
+ ->getMock(),
+ $this->getMockBuilder('\OCP\IConfig')
+ ->disableOriginalConstructor()
+ ->getMock()
);
$security = $this->container['SecurityMiddleware'];
$dispatcher = $this->container['MiddlewareDispatcher'];