mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-03 02:09:45 +07:00
Merge pull request #1638 from owncloud/test-bootstrap
Mention test requirement on bootstrap.php
This commit is contained in:
@@ -14,6 +14,12 @@ The PHP tests go into the **tests/** directory. Unfortunately the classloader in
|
||||
|
||||
phpunit tests/
|
||||
|
||||
When writing your own tests, please ensure that PHPUnit bootstraps from :file:`tests/bootstrap.php`, to set up various environment variables and autoloader registration correctly. Without this, you will see errors as the ownCloud autoloader security policy prevents access to the tests/ subdirectory. This can be configured in your :file:`phpunit.xml` file as follows:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<phpunit bootstrap="../../tests/bootstrap.php">
|
||||
|
||||
PHP classes should be tested by accessing them from the container to ensure that the container is wired up properly. Services that should be mocked can be replaced directly in the container.
|
||||
|
||||
A test for the **AuthorStorage** class in :doc:`filesystem`:
|
||||
|
||||
Reference in New Issue
Block a user