Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christophwurst/nextcloud_testing
Simple and fast unit and integration testing framework for Nextcloud, based on PHPUnit
https://github.com/christophwurst/nextcloud_testing
Last synced: 3 months ago
JSON representation
Simple and fast unit and integration testing framework for Nextcloud, based on PHPUnit
- Host: GitHub
- URL: https://github.com/christophwurst/nextcloud_testing
- Owner: ChristophWurst
- License: mit
- Created: 2018-02-12T11:35:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-30T07:43:23.000Z (about 1 year ago)
- Last Synced: 2024-10-07T10:27:24.129Z (4 months ago)
- Language: PHP
- Size: 34.2 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nextcloud Testing
Simple and fast unit and integration testing framework for Nextcloud 25+, based on PHPUnit
Features
* Minimal setUp/tearDown overhead for unit tests
* Simple trait-based mechanism to reset database after integration tests
* Based on PHPUnit## Unit Tests
Use ``TestCase`` as base class for your test case:
```php
webDriver`:```php
webDriver->get('http://localhost:8080/index.php/login');…
}}
```This framework targets [Sauce Labs](https://saucelabs.com/) as testing back-end that runs the test
browser instances. Hence, it is necessary to set the `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` env
variables. `SELENIUM_BROWSER` lets you choose the browser to run your tests against.## Test Users
Include the `TestUser` trait in your test case to conveniently generate new test users. The trait
will create a new user with a random UID (including collision detection).```php
createTestUser();…
}}
```The returned user is of type `IUser`. You can read its UID with `$user->getUID()`. Note that the
user is not removed after the test.