diff --git a/apps/files_external/controller/userglobalstoragescontroller.php b/apps/files_external/controller/userglobalstoragescontroller.php index 85e843a423..6d4548754d 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 afc30de456..741e906dec 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 dd761fa976..671e019fea 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 51b4145b7a..dd9b31f3ed 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 ed8f437e0a..72f061e05b 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')