summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@owncloud.com>2016-05-02 10:58:44 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2016-05-11 13:36:46 +0200
commitdff108e97bea1d1b6e6a639fabd64d400acd4347 (patch)
treecf6a4a2d826d80ca4c66f749ba20c872c8f2e72d /tests/lib
parentfbb5768587cc0ba5daefc391003ce0177970c5b8 (diff)
downloadnextcloud-server-dff108e97bea1d1b6e6a639fabd64d400acd4347.tar.gz
nextcloud-server-dff108e97bea1d1b6e6a639fabd64d400acd4347.zip
fix mock builder for old phpunit versions
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/authentication/token/defaulttokencleanupjobtest.php4
-rw-r--r--tests/lib/authentication/token/defaulttokenprovidertest.php12
2 files changed, 12 insertions, 4 deletions
diff --git a/tests/lib/authentication/token/defaulttokencleanupjobtest.php b/tests/lib/authentication/token/defaulttokencleanupjobtest.php
index 53cab00df31..c9082c08b30 100644
--- a/tests/lib/authentication/token/defaulttokencleanupjobtest.php
+++ b/tests/lib/authentication/token/defaulttokencleanupjobtest.php
@@ -34,7 +34,9 @@ class DefaultTokenCleanupJobTest extends TestCase {
protected function setUp() {
parent::setUp();
- $this->tokenProvider = $this->getMockWithoutInvokingTheOriginalConstructor('\OC\Authentication\Token\DefaultTokenProvider');
+ $this->tokenProvider = $this->getMockBuilder('\OC\Authentication\Token\DefaultTokenProvider')
+ ->disableOriginalConstructor()
+ ->getMock();
$this->overwriteService('\OC\Authentication\Token\DefaultTokenProvider', $this->tokenProvider);
$this->job = new DefaultTokenCleanupJob();
}
diff --git a/tests/lib/authentication/token/defaulttokenprovidertest.php b/tests/lib/authentication/token/defaulttokenprovidertest.php
index 47bddffa011..54e29a7ef52 100644
--- a/tests/lib/authentication/token/defaulttokenprovidertest.php
+++ b/tests/lib/authentication/token/defaulttokenprovidertest.php
@@ -40,7 +40,9 @@ class DefaultTokenProviderTest extends TestCase {
protected function setUp() {
parent::setUp();
- $this->mapper = $this->getMockWithoutInvokingTheOriginalConstructor('\OC\Authentication\Token\DefaultTokenMapper');
+ $this->mapper = $this->getMock('\OC\Authentication\Token\DefaultTokenMapper')
+ ->disableOriginalConstructor()
+ ->getMock();
$this->crypto = $this->getMock('\OCP\Security\ICrypto');
$this->config = $this->getMock('\OCP\IConfig');
$this->logger = $this->getMock('\OCP\ILogger');
@@ -81,7 +83,9 @@ class DefaultTokenProviderTest extends TestCase {
}
public function testUpdateToken() {
- $tk = $this->getMockWithoutInvokingTheOriginalConstructor('\OC\Authentication\Token\DefaultTokenProvider');
+ $tk = $this->getMockBuilder('\OC\Authentication\Token\DefaultTokenProvider')
+ ->disableOriginalConstructor()
+ ->getMock();
$tk->expects($this->once())
->method('setLastActivity')
->with(time());
@@ -94,7 +98,9 @@ class DefaultTokenProviderTest extends TestCase {
public function testGetPassword() {
$token = 'token1234';
- $tk = $this->getMockWithoutInvokingTheOriginalConstructor('\OC\Authentication\Token\DefaultToken');
+ $tk = $this->getMockBuilder('\OC\Authentication\Token\DefaultToken')
+ ->disableOriginalConstructor()
+ ->getMock();
$tk->expects($this->once())
->method('getPassword')
->will($this->returnValue('someencryptedvalue'));