diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-15 10:56:40 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-15 10:56:40 +0200 |
commit | 466297829e978f03421f5e34a4b2c7213332163c (patch) | |
tree | 5bf5725cc2053d525c0adfd25827674465c35db1 /tests | |
parent | 47388e1cfe049265050614f55744adcd77ee8052 (diff) | |
download | nextcloud-server-466297829e978f03421f5e34a4b2c7213332163c.tar.gz nextcloud-server-466297829e978f03421f5e34a4b2c7213332163c.zip |
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Authentication/Token/DefaultTokenProviderTest.php | 8 | ||||
-rw-r--r-- | tests/lib/Authentication/Token/DefaultTokenTest.php | 8 |
2 files changed, 3 insertions, 13 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php index 08c74961c0d..a2128e0fd4c 100644 --- a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php @@ -24,10 +24,10 @@ namespace Test\Authentication\Token; use OC\Authentication\Exceptions\InvalidTokenException; use OC\Authentication\Token\DefaultToken; +use OC\Authentication\Token\DefaultTokenMapper; use OC\Authentication\Token\DefaultTokenProvider; use OC\Authentication\Token\IToken; use OCP\AppFramework\Db\DoesNotExistException; -use OCP\AppFramework\Db\Mapper; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; use OCP\ILogger; @@ -39,7 +39,7 @@ class DefaultTokenProviderTest extends TestCase { /** @var DefaultTokenProvider|\PHPUnit_Framework_MockObject_MockObject */ private $tokenProvider; - /** @var Mapper|\PHPUnit_Framework_MockObject_MockObject */ + /** @var DefaultTokenMapper|\PHPUnit_Framework_MockObject_MockObject */ private $mapper; /** @var ICrypto|\PHPUnit_Framework_MockObject_MockObject */ private $crypto; @@ -55,9 +55,7 @@ class DefaultTokenProviderTest extends TestCase { protected function setUp() { parent::setUp(); - $this->mapper = $this->getMockBuilder('\OC\Authentication\Token\DefaultTokenMapper') - ->disableOriginalConstructor() - ->getMock(); + $this->mapper = $this->createMock(DefaultTokenMapper::class); $this->crypto = $this->createMock(ICrypto::class); $this->config = $this->createMock(IConfig::class); $this->logger = $this->createMock(ILogger::class); diff --git a/tests/lib/Authentication/Token/DefaultTokenTest.php b/tests/lib/Authentication/Token/DefaultTokenTest.php index f00c32ccaf5..76b976586a9 100644 --- a/tests/lib/Authentication/Token/DefaultTokenTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenTest.php @@ -33,14 +33,6 @@ class DefaultTokenTest extends TestCase { $this->assertEquals($scope, $token->getScopeAsArray()); } - public function testSetScopeAsString() { - $scope = ['filesystem' => false]; - $token = new DefaultToken(); - $token->setScope(json_encode($scope)); - $this->assertEquals(json_encode($scope), $token->getScope()); - $this->assertEquals($scope, $token->getScopeAsArray()); - } - public function testDefaultScope() { $scope = ['filesystem' => true]; $token = new DefaultToken(); |