From 04acae9c46d37ee5d1a9dc7abb91ff7838d78140 Mon Sep 17 00:00:00 2001 From: Robin McCorkell Date: Wed, 2 Sep 2015 14:57:05 +0100 Subject: [PATCH] Mention test requirement on bootstrap.php --- developer_manual/app/testing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/developer_manual/app/testing.rst b/developer_manual/app/testing.rst index 11a253881..78da21064 100644 --- a/developer_manual/app/testing.rst +++ b/developer_manual/app/testing.rst @@ -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 + + + 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`: