Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1638 from owncloud/test-bootstrap
Browse files Browse the repository at this point in the history
Mention test requirement on bootstrap.php
  • Loading branch information
Robin McCorkell committed Sep 2, 2015
2 parents b175013 + 04acae9 commit 2302fa8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions developer_manual/app/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down

0 comments on commit 2302fa8

Please sign in to comment.