Commit Graph

50 Commits

Author SHA1 Message Date
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Robin Appelman
e704470c79
update tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-08-31 22:37:10 +02:00
Côme Chilliet
b294edad80
Merge branch 'master' into enh/type-iconfig-getter-calls
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2023-04-20 16:52:38 +02:00
Ferdinand Thiessen
dc9d8c42bb fix: Adjust console formatter code to match with Symfony type hints
Symfony has added type hints on the `OutputFormatterInterface`,
so we must adjust our type hints to match with Symfony.

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2023-04-17 18:35:10 +02:00
Côme Chilliet
8d5165e8dc
Adapt tests to config value typing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 17:42:14 +02:00
Joas Schilling
47880b143d
Remove failing test that works with mocks only anyway
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-02 18:06:31 +01:00
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Côme Chilliet
ee06261b82
Fix codestyle in modified files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-05 16:08:40 +01:00
Côme Chilliet
30560d3165
Merge branch 'master' into tests/fix-phpunit-warnings
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2022-12-05 12:03:39 +01:00
Côme Chilliet
324126888e
Add Union types for properties in tests/lib/Encryption/Keys/StorageTest.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-15 09:29:35 +01:00
Côme Chilliet
70e2217d1c
Fix dynamic properties and other problems in tests for PHP 8.2
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-14 16:14:35 +01:00
Julius Härtl
908b7aa70a
Attempt to fix CalendarImpl tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-11-09 16:37:34 +01:00
Carl Schwan
458c2fa297
Remove OCP\App and OCP\BackgroundJob
Both deprecated since NC 23

IAppManager is the replacement for OCP\App unfortunately it can't be
dependency injected in classes used by the installed otherwise the
database connection is initialised too early

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-01 09:46:40 +02:00
Côme Chilliet
6a1510f8ee
Remove some more at matchers in tests/lib
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-20 10:53:06 +02:00
Vincent Petry
b212e8dcc9
Add unit tests for encryption's isSystemWideMountPoint
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-06-01 18:10:59 +02:00
Côme Chilliet
61f7f13bd8
Migrate from ILogger to LoggerInterface where needed in the tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:26 +01:00
Carl Schwan
6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 00:19:07 +01:00
Côme Chilliet
065531570d
Fix Encryption tests on PHP 8.1
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:28:59 +01:00
Julius Härtl
76170a58eb
Log and continue when failing to update encryption keys during for individual files
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-03-19 14:12:07 +01:00
Christoph Wurst
d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +02:00
Roeland Jago Douma
5340ab3a75
New SSE key format
* Encrypt the keys with the instance secret
* Store them as json (so we can add other things if needed)

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-08-20 15:42:43 +02:00
Morris Jobke
234b510652
Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-12 13:55:19 +02:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst
afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +02:00
Christoph Wurst
41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +02:00
Christoph Wurst
463b388589
Merge pull request #20170 from nextcloud/techdebt/remove-unused-imports
Remove unused imports
2020-03-27 17:14:08 +01:00
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Christoph Wurst
2ee65f177e
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:21:27 +01:00
Christoph Wurst
74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:08:08 +01:00
Roeland Jago Douma
3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 15:27:18 +01:00
Roeland Jago Douma
c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 13:34:41 +01:00
Roeland Jago Douma
68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Robin Appelman
67a46b5aa9
update encryption wrapper tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-11-29 16:34:49 +01:00
Bjoern Schiessle
d76a87f3b0
skip already decrypted files on decrypt all command
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-10-24 16:53:39 +02:00
Joas Schilling
3917a54113
Class "ProgressBar" is declared "final" and cannot be mocked.
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-01-25 11:33:26 +01:00
Joas Schilling
870023365c
Fix "Undefined method setExpectedException()"
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-01-24 18:10:16 +01:00
Morris Jobke
c733cdaa65
Use ::class in test mocks of encryption app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-26 13:56:56 +02:00
Morris Jobke
ab36980d20
Use ::class in test mocks of dav app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-26 10:16:12 +02:00
Morris Jobke
43e498844e
Use ::class in test mocks
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-24 17:45:32 +02:00
Joas Schilling
a0ada9aab4
Don't use deprecated getMock() anymore
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-20 12:30:21 +02:00
Joas Schilling
1c0bffe87f
Fix translations
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-18 16:40:53 -05:00
Bjoern Schiessle
fcda3a20f4
create new encryption keys on password reset and backup the old one
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-01-10 17:04:32 +01:00
Vincent Petry
fca8bd44ab
Fix shared storage namespace in DecryptAll class 2016-10-20 20:36:50 +02:00
Joas Schilling
246bb9f33d
Move OC\Files\Storage\Shared to the right namespace 2016-10-20 20:27:44 +02:00
Roeland Jago Douma
3782edf49c
Fix getMock DecryptAllTest 2016-09-13 09:09:52 +02:00
Roeland Jago Douma
4da1ee99d6
Fix getMock Encryption 2016-09-07 20:42:37 +02:00
Bjoern Schiessle
351cab6bce
skip shared files, if files get decrypted only for a specific user we shouldn't touch files owned by a different user. 2016-07-27 15:39:24 +02:00
Joas Schilling
d4ba982131
Allow to decrypt user '0' files only 2016-06-07 09:13:11 +02:00
Björn Schießle
b15babd061
fix unit tests 2016-05-30 14:49:27 +02:00
Joas Schilling
94ad54ec9b Move tests/ to PSR-4 (#24731)
* Move a-b to PSR-4

* Move c-d to PSR-4

* Move e+g to PSR-4

* Move h-l to PSR-4

* Move m-r to PSR-4

* Move s-u to PSR-4

* Move files/ to PSR-4

* Move remaining tests to PSR-4

* Remove Test\ from old autoloader
2016-05-20 15:38:20 +02:00