Commit graph

5535 commits

Author SHA1 Message Date
Julius Härtl
68a0639450
Show unique displayname context in the sharing input
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-01-05 10:09:23 +01:00
Daniel Calviño Sánchez
68f67d9c9e Add unit tests for "validateExpirationDateInternal"
They were copied and adjusted as needed from the tests for
"validateExpirationDate".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
713e87909a Add explicit time to test date for clarity
This shows in a clearer way that the expected expiration date is the
original one, but without time.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
c138d2d251 Add unit test for expiration date with date and with default
This adds back what was being actually tested in the unit test fixed in
the previous commit.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
2f8f06fe37 Fix unit test for expiration date without date but with default
The expiration date was explicitly given, so it was not testing what it
should. Moreover, "link_defaultExpDays" needs to be mapped when testing
the default value (even if it will just fallback to the value of
"shareapi_expire_after_n_days").

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
6cf3c294a1 Fix unit test method name
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
eae5fa876c Fix unit test for verifying enforced valid expiration date.
The enforced expiration date was not actually enabled, as for that
"shareapi_default_expire_date" needs to be explicitly set to "yes".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
f4f39fc157 Fix unit test for verifying enforced expire date too far in the future
The test should fail if no exception was thrown, and no exception was
thrown due to a missing configuration parameter. However, the use of
"addToAssertionCount(1)" made the test pass even if no exception was
thrown and, therefore, to silently fail.

Now the missing configuration parameter was added and the test will fail
if the expected exception is not thrown.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
aaeaed072f Add unit tests to enforce a relaxed default share expiration date
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
47897090ec Remove wrong and misleading comment
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
66eb1233a7 Remove extra spaces
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
e9dfa135a1 Fix typo in variable name
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Daniel Calviño Sánchez
f59238444a Fix typos in method names
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 15:37:12 +01:00
Christoph Wurst
1d0a70e416 Use the shorter phpunit syntax for mocked return values in ManagerTest
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-11-16 15:35:02 +01:00
Daniel Calviño Sánchez
8ebe5a140d Add acceptance tests for reshares by link when resharing is disabled
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-11 13:27:47 +01:00
Daniel Calviño Sánchez
44d1d158de Add acceptance tests for reshares when resharing is disabled
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-11 13:27:47 +01:00
Julius Härtl
338498f967
Only retry fetching app store data once every 5 minutes in case it fails
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-09 11:47:22 +01:00
Joas Schilling
83b78f6b7d Also run for .sh and .json (when not package or package-lock)
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-30 12:12:44 +00:00
Joas Schilling
e5ec578d01 Also run all tests when drone config is modified
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-30 12:12:43 +00:00
Joas Schilling
868fa35f1f Only run phpunit when php, xml or test files are modified
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-30 12:12:42 +00:00
Morris Jobke
f858e438ef
Merge pull request #23626 from nextcloud/backport/23614/stable18
[stable18] Disable unreliable app-files-sharing.feature:108
2020-10-22 15:58:14 +02:00
Morris Jobke
385d3270c7 Disable unreliable app-files-sharing.feature:108
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-22 10:28:27 +00:00
Morris Jobke
abc1679fd9 Disable unreliable app-files.feature:108
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-22 10:27:07 +00:00
Morris Jobke
afeafd91a4
Clear cached app config while waiting for the SCSSCache to finish processing the file
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-16 18:28:54 +02:00
Joas Schilling
963a03e108
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-15 11:17:33 +02:00
Daniel Calviño Sánchez
6d191c22f0 Fix clicks on actions menu of non opaque file rows in acceptance tests
When a row is added to the file list the opacity of the file row is
animated from transparent to fully opaque. As the file actions menu is a
descendant of the row but overflows it when the row is not fully opaque
clicks on the menu entries "fall-through" and are received instead by
the rows behind.

The opacity animation is a CSS animation, and it is not possible to know
if a row is appearing or not except from its opacity (the row will have
the "appear" CSS class even after the animation ended). Therefore it
should be waited until the row of the file is fully opaque before using
the menu.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-08-31 09:42:25 +02:00
Robin Appelman
98ca765572
use exceptions for error signaling in writeStream
this remove the ambiguity when writing zero length files

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-31 17:33:10 +02:00
Robin Appelman
e860507201
rollback cache rename if trashbin move fails
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-31 17:33:03 +02:00
Morris Jobke
3ab2e4d41c
Remove deprecated test of internal attributes via assertAttributeEquals in constructor tests
I removed the tests completely because they just test that the constructor assigns the values to the internal properties. Nothing that should be cared about from the outside.

See https://github.com/sebastianbergmann/phpunit/issues/3339#issuecomment-428843322

It is seen as bad practice to test internal stuff of objects instead of the actual input and output of mathod calls.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 13:19:16 +02:00
Morris Jobke
a4a086e296
Use assertEqualsCanonicalizing instead of deprecated assertEquals parameter
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 13:18:20 +02:00
Morris Jobke
7a49d0fbea
Remove deprecated test of internal attributes via assertAttributeEquals
See https://github.com/sebastianbergmann/phpunit/issues/3339#issuecomment-428843322

It is seen as bad practice to test internal stuff of objects instead of the actual input and output of mathod calls.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 13:18:14 +02:00
Morris Jobke
3904acfe93
Use assertStringContainsString instead of assertContains on strings
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 13:17:13 +02:00
Robin Appelman
2eb61b4111 ensure mounts are scanned during tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-09 12:33:29 +00:00
Roeland Jago Douma
bb9da25772 Use the correct mountpoint to calculate
If we use the owners mount point this results in null. And then the rest
of the checks get called with null. Which doesn't work.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-09 12:33:26 +00:00
Morris Jobke
778cb33576
Merge pull request #21499 from lmamane/stable18-21285-oneliner
fix #21285 as oneliner
2020-07-08 13:04:58 +02:00
Morris Jobke
52167ddc39
Merge pull request #21575 from nextcloud/backport/21379/stable18
[stable18] Fix share permission checkboxes enabled when permissions can not be set
2020-07-06 23:00:38 +02:00
Roeland Jago Douma
01669bdc86
Merge pull request #21670 from nextcloud/revert-21096-backport/21090/stable18
Revert "[stable18] Do not read certificate bundle from data dir by default"
2020-07-06 10:38:48 +02:00
Roeland Jago Douma
c9eede0acf
Merge pull request #21388 from nextcloud/backport/21380/stable18
[stable18] Increase timeout of the appstore requests
2020-07-04 08:55:18 +02:00
Roeland Jago Douma
f3cb2a8208
Revert "[stable18] Do not read certificate bundle from data dir by default" 2020-07-03 14:21:28 +02:00
Joas Schilling
b5a64321f5
Increase timeout of the appstore requests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-03 10:10:07 +02:00
Roeland Jago Douma
464b9fbe09
Merge pull request #21551 from nextcloud/backport/21535/stable18
[stable18] Fix language in share notes email for users
2020-07-02 21:00:45 +02:00
Joas Schilling
8cba764b59 Fix IPv6 remote addresses from X_FORWARDED_FOR headers before validating
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-02 10:09:45 +00:00
Daniel Calviño Sánchez
047b5407d6 Add acceptance test for disabling create permission after sharing
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-24 19:24:58 +00:00
Daniel Calviño Sánchez
a3f1bb70bd Add acceptance test for sharing a folder without create permission
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-24 19:24:58 +00:00
Daniel Calviño Sánchez
47222e9ad4 Add acceptance test for sharing a file without edit permission
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-24 19:24:57 +00:00
Daniel Calviño Sánchez
b2b02ff353 Generalize functions to get locators for share permission checkboxes
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-24 19:24:57 +00:00
Joas Schilling
70cf8bd7fc
Fix language in share notes email for users
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-24 09:10:55 +02:00
Joas Schilling
0d86989706
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-23 14:55:26 +02:00
Lionel Elie Mamane
c173602f88 adapt testGetLoginCredentialsInvalidTokenLoginCredentials() unit test to uid != loginname
Signed-off-by: Lionel Elie Mamane <lionel@mamane.lu>
2020-06-20 11:52:42 +02:00
Arthur Schiwon
a71701f2e7
acceptence tests shall specify which branch to pick when cloning apps
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-06-19 21:13:09 +02:00