Julius Härtl
9161f6ca4a
Remove tests that just prove mocked calls and don't actually validate anything useful
Signed-off-by: Julius Härtl <jus@bitgrid.net>
5 years ago
Julius Härtl
cab44b6311
Run oci tests against phpunit9/php8
Signed-off-by: Julius Härtl <jus@bitgrid.net>
5 years ago
Joas Schilling
cd35a5c71d
Make Testcase class compatible with phpunit-9.5
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
dependabot-preview[bot]
eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard ) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases )
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md )
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Christoph Wurst
f0c6cfde3a
Rollback failed transactions in TestCase.php to not break followup tests
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Roeland Jago Douma
b668850aa1
Fix filesystem tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
5 years ago
Morris Jobke
f5a52e941c
Overwrite also the new command bus name to execute them in sync in the tests
Followup to #23245
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
5 years ago
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>
5 years ago
Joas Schilling
bab4fb98eb
Fix overwriteService() for apps
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
Robin Appelman
37c334a2a6
ensure mounts are scanned during tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
5 years ago
Christoph Wurst
1584c9ae9c
Add visibility to all methods and position of static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
a7c8d26d31
Add visibility to all properties and move static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
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>
6 years ago
Christoph Wurst
44577e4345
Remove trailing and in between spaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
2ee65f177e
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Roeland Jago Douma
c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Arthur Schiwon
eded07f28f
whitelist audit.log
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
7 years ago
Joas Schilling
c3424df1f0
Require PHPUnit 6.5 or higher
Signed-off-by: Joas Schilling <coding@schilljs.com>
8 years ago
Morris Jobke
55532f19d9
Cleanup OC_User and OCP\User
* mainly removes deprecated methods and old static code
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
8 years ago
Morris Jobke
43e498844e
Use ::class in test mocks
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
8 years ago
Robin Appelman
9731350ace
split async test bus for easier subclassing
8 years ago
Morris Jobke
5b4adf66e5
Move OC_Defaults to OCP\Defaults
* currently there are two ways to access default values:
OCP\Defaults or OC_Defaults (which is extended by
OCA\Theming\ThemingDefaults)
* our code used a mixture of both of them, which made
it hard to work on theme values
* this extended the public interface with the missing
methods and uses them everywhere to only rely on the
public interface
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
9 years ago
Roeland Jago Douma
0fb5776133
Fix NODB tests etc
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
9 years ago
Roeland Jago Douma
1565177fb5
Revert "Add a magic wrapper to allow phpunit4 to run the code again "
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
9 years ago
Thomas Müller
b62b82c2de
Fix reporting of risky tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
9 years ago
Joas Schilling
e76ef9aaa8
Add a magic wrapper from hell to allow phpunit4 to run the code again
Remove this once phpunit 5 is the lowest supported version, by reverting:
https://github.com/nextcloud/server/pull/2137
Signed-off-by: Joas Schilling <coding@schilljs.com>
9 years ago
Thomas Müller
506ccdbd8d
Introduce an event for first time login based on the last login time stamp
Use firstLogin event to trigger creation of default calendar and default address book
Delay login of admin user after setup so that firstLogin event can properly be processed for the admin
Fixing tests ...
Skeleton files are not copied over -> only 3 cache entries are remaining
Use updateLastLoginTimestamp to properly setup lastLogin value for a test user
9 years ago
Joas Schilling
4393e8003b
Make sure the database is not replaced while we make a backup of the service
Signed-off-by: Joas Schilling <coding@schilljs.com>
9 years ago
Lukas Reschke
6920e609c0
Adjust tests and DI for Share.php
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
9 years ago
Vincent Petry
f737426eca
Add using casing check/fix for initMountPoints
9 years ago
Joas Schilling
9f2d9895a5
Restore all services when a tests failed/finished for better testcase isolation
Signed-off-by: Joas Schilling <coding@schilljs.com>
9 years ago
Lukas Reschke
a1f5364d7f
Generate coverage for quick DB tests
This adds the "QUICKDB" group which excludes some tests that abuse unit tests as integration tests as displayed in https://github.com/nextcloud/server/issues/1626
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
9 years ago
Joas Schilling
db710e0b03
Make tests work with 4.8 at least
9 years ago
Robin Appelman
e8e950a4d2
more efficient querying of numeric storage ids
9 years ago
Robin Appelman
2693ae870e
cache user folders
9 years ago
Thomas Pulzer
90b7f74da7
Changed name of default logfile from owncloud.log to nextcloud.log.
10 years ago
Vincent Petry
5b1eb416d8
Fix TestCase::invokePrivate to work with static classes
10 years ago
Joas Schilling
f8180391fd
Create a Fallback in the old autoloader for PSR-4 Test\TestCase
10 years ago
Roeland Jago Douma
eb79b83831
Move functions.php to legacy
This file should really be properly namespaced etc!
10 years ago
Thomas Müller
fdee771aca
Add unit testing capabilities for templates ( #23708 )
Add unit testing capabilities for templates
10 years ago
Stefan Weil
02e226a6b3
tests: Fix typos (found by codespell)
Fix also a small grammar issue.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
10 years ago
Joas Schilling
70396581eb
Add tests for findLanguage()
10 years ago
Roeland Jago Douma
98c4951f45
getLowStrengthGenerator does not do anything anymore
10 years ago
Vincent Petry
d7169ffdec
Restore DB connection after failure
In case of failure, PHPUnit seems to skip `tearDown`, so any useful
assertion messages cannot be shown because `tearDownAfterClass` is
throwing an error because of database usage.
This commit makes sure we also restore the database in
`tearDownAfterClass` to prevent the data root restoration to fail
10 years ago
Thomas Müller
2709244acd
Only perform tearDown operations on the database if we have a connection to it .....
10 years ago
Thomas Müller
26f416b9f5
Assert that there are no xml error left
10 years ago
Thomas Müller
dddfa6de78
Don't break app on travis
10 years ago
Thomas Müller
03ee3b9aec
A TestCase which is not annotated to be in group DB will not allow access to the database connection.
This is necessary to categorize unit test and avoid duplicate test case execution - it also allows us to closely review unit test implementations to identify unnecessary db calls.
10 years ago