Commit Graph

32 Commits

Author SHA1 Message Date
Thomas Müller fdee771aca Add unit testing capabilities for templates (#23708)
Add unit testing capabilities for templates
2016-04-12 12:49:11 +02:00
Stefan Weil 02e226a6b3 tests: Fix typos (found by codespell)
Fix also a small grammar issue.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-04-06 15:08:27 +02:00
Joas Schilling 70396581eb Add tests for findLanguage() 2016-01-26 14:02:32 +01:00
Roeland Jago Douma 98c4951f45 getLowStrengthGenerator does not do anything anymore 2016-01-11 19:59:15 +01:00
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
2015-12-21 18:14:29 +01:00
Thomas Müller 2709244acd Only perform tearDown operations on the database if we have a connection to it ..... 2015-12-17 17:29:50 +01:00
Thomas Müller 26f416b9f5 Assert that there are no xml error left 2015-12-17 17:18:42 +01:00
Thomas Müller dddfa6de78 Don't break app on travis 2015-11-30 10:55:13 +01:00
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.
2015-11-30 10:55:05 +01:00
Joas Schilling 42b29e39c1 Clear the shares after the test like storages and files 2015-10-05 10:13:45 +02:00
Martin 491250320a Replaces if ($file === '.' || $file === '..') by if(\OC\Files\Filesystem::isIgnoredDir($file)). Eases to find where this operation is used. 2015-09-22 17:53:15 +02:00
Robin Appelman 3dbfbdaf54 allow moving common test logic into traits 2015-08-20 15:17:14 +02:00
Thomas Müller f55aa856ad Remove file mapper - was only use in Windows and never worked properly 2015-07-03 15:41:29 +02:00
Vincent Petry eae08d0adc Release locks after class in tests 2015-06-25 16:33:02 +02:00
Vincent Petry 538e466c30 Keep shared locks in post hooks
Instead of unlocking after the file operation, change exclusive locks
back to shared locks during post hooks, and unlock after that.

Also added unit tests to test locking in pre-hooks, during operation and
post-hooks.
2015-06-25 16:33:02 +02:00
Vincent Petry 4497aa4c68 Webdav PUT small file lock must be shared during hooks
Fixed code path for Webdav PUT of small files to use shared locks during
hook execution, and exclusive during the file operation

This makes it possible for versions to be copied by accessing the file
in a post_write hook.
2015-06-12 18:52:18 +02:00
Joas Schilling d3e3a84cae Move the helpful method to the TestCase class 2015-06-03 12:33:29 +02:00
Robin Appelman b98dd3ceb8 release all locks after test 2015-06-01 13:22:56 +02:00
Robin Appelman a5d652a6b8 fix tests 2015-05-18 12:11:31 +02:00
Robin Appelman 415f16eb24 fix tests 2015-05-18 12:11:31 +02:00
Vincent Petry eab55aa959 Properly log out test users in unit tests 2015-05-15 12:33:17 +02:00
Vincent Petry f8cfc03f36 Replace originalStorage in tests with a proper teardown
The purpose of $originalStorage in unit tests was to remount the old
root.
However that storage itself is already wrapped by storage wrapper, so
remounting it would rewrap the storage several times.

This fix makes use of "loginAsUser()" and "logout()" from the TestCase
class to properly initialize and cleanup the FS as expected.
2015-04-08 12:45:38 +02:00
Thomas Müller 1b42b492dc kill OC_FileProxy 💥 2015-04-07 13:30:28 +02:00
Robin Appelman ddd6a67d2a Handle exceptions thrown during hooks when running unit tests 2015-03-26 17:07:02 +01:00
Robin Appelman 3ed6ed3c36 Force test cases using background commands to handle setting up the filesystem 2015-03-26 17:07:02 +01:00
Robin Appelman 00568af74d Allow running the async commands from unit tests 2015-03-02 15:25:31 +01:00
Vincent Petry 5101bc54fa Add login/logout to TestCase base class 2014-12-10 16:11:27 +01:00
Joas Schilling ea4c25609d Replace uniqid calls with $this->getUniqueID so tests pass again on windows 2014-12-03 12:10:55 +01:00
Joas Schilling e1f3abf7a5 Correctly namespace and autoload DatabaseException 2014-11-27 11:10:04 +01:00
Joas Schilling 84d358a761 Clean up the test data in tearDownAfterClass()
The result of the listener should then be empty and can be removed
2014-11-20 15:26:26 +01:00
Joas Schilling bb540722cd Use base class to reset the file mapper 2014-11-19 14:52:07 +01:00
Joas Schilling 62047f86f5 Testcase base class 2014-11-06 17:36:34 +01:00