diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-01-15 15:18:55 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-18 12:08:58 +0100 |
commit | 7ba715d14418f8cb8703528f7373d76492410e38 (patch) | |
tree | dd5feb8ad03a1c739fcf5a8681643cb309f5489e | |
parent | 7e01f32c27726a50d0f7761dda70b4e34a5e421d (diff) | |
download | nextcloud-server-7ba715d14418f8cb8703528f7373d76492410e38.tar.gz nextcloud-server-7ba715d14418f8cb8703528f7373d76492410e38.zip |
fix test
5 files changed, 24 insertions, 7 deletions
diff --git a/apps/files_external/controller/userglobalstoragescontroller.php b/apps/files_external/controller/userglobalstoragescontroller.php index 85e843a4235..6d4548754df 100644 --- a/apps/files_external/controller/userglobalstoragescontroller.php +++ b/apps/files_external/controller/userglobalstoragescontroller.php @@ -103,7 +103,6 @@ class UserGlobalStoragesController extends StoragesController { * @param int $id storage id * @return DataResponse * - * @NoCSRFRequired * @NoAdminRequired */ public function show($id) { diff --git a/apps/files_external/controller/userstoragescontroller.php b/apps/files_external/controller/userstoragescontroller.php index afc30de456b..741e906dec1 100644 --- a/apps/files_external/controller/userstoragescontroller.php +++ b/apps/files_external/controller/userstoragescontroller.php @@ -53,6 +53,7 @@ class UserStoragesController extends StoragesController { * @param IRequest $request request object * @param IL10N $l10n l10n service * @param UserStoragesService $userStoragesService storage service + * @param IUserSession $userSession */ public function __construct( $AppName, diff --git a/apps/files_external/tests/controller/userstoragescontrollertest.php b/apps/files_external/tests/controller/userstoragescontrollertest.php index dd761fa9767..671e019fea0 100644 --- a/apps/files_external/tests/controller/userstoragescontrollertest.php +++ b/apps/files_external/tests/controller/userstoragescontrollertest.php @@ -48,7 +48,8 @@ class UserStoragesControllerTest extends StoragesControllerTest { 'files_external', $this->getMock('\OCP\IRequest'), $this->getMock('\OCP\IL10N'), - $this->service + $this->service, + $this->getMock('\OCP\IUserSession') ); } diff --git a/tests/lib/db/connection.php b/tests/lib/db/connection.php index 51b4145b7a0..dd9b31f3ed7 100644 --- a/tests/lib/db/connection.php +++ b/tests/lib/db/connection.php @@ -105,7 +105,8 @@ class Connection extends \Test\TestCase { $this->connection->setValues('table', [ 'integerfield' => 1 ], [ - 'textfield' => 'foo' + 'textfield' => 'foo', + 'clobfield' => 'not_null' ]); $this->assertEquals('foo', $this->getTextValueByIntergerField(1)); @@ -118,7 +119,8 @@ class Connection extends \Test\TestCase { $this->connection->setValues('table', [ 'integerfield' => 1 ], [ - 'textfield' => 'foo' + 'textfield' => 'foo', + 'clobfield' => 'not_null' ]); $this->connection->setValues('table', [ @@ -138,7 +140,8 @@ class Connection extends \Test\TestCase { 'integerfield' => 1 ], [ 'textfield' => 'foo', - 'booleanfield' => true + 'booleanfield' => true, + 'clobfield' => 'not_null' ]); $this->connection->setValues('table', [ @@ -163,7 +166,8 @@ class Connection extends \Test\TestCase { 'integerfield' => 1 ], [ 'textfield' => 'foo', - 'booleanfield' => true + 'booleanfield' => true, + 'clobfield' => 'not_null' ]); $this->connection->setValues('table', [ diff --git a/tests/lib/security/credentialsmanager.php b/tests/lib/security/credentialsmanager.php index ed8f437e0ac..72f061e05bb 100644 --- a/tests/lib/security/credentialsmanager.php +++ b/tests/lib/security/credentialsmanager.php @@ -43,6 +43,18 @@ class CredentialsManagerTest extends \Test\TestCase { $this->manager = new CredentialsManager($this->crypto, $this->dbConnection); } + private function getQeuryResult($row) { + $result = $this->getMockBuilder('\Doctrine\DBAL\Driver\Statement') + ->disableOriginalConstructor() + ->getMock(); + + $result->expects($this->any()) + ->method('fetch') + ->will($this->returnValue($row)); + + return $result; + } + public function testStore() { $userId = 'abc'; $identifier = 'foo'; @@ -78,7 +90,7 @@ class CredentialsManagerTest extends \Test\TestCase { ->getMock(); $qb->expects($this->once()) ->method('execute') - ->willReturn(['credentials' => 'baz']); + ->willReturn($this->getQeuryResult(['credentials' => 'baz'])); $this->dbConnection->expects($this->once()) ->method('getQueryBuilder') |