All app developers, please note that due to recent security enhancements
in ownCloud 8.2 regarding restrictions on the autoloader, there is an
additional step you must ensure to keep your PHPUnit app unit tests
working. The autoloader now restricts the directories it will load files
from, and by default excludes the /tests directory, so you may see
errors like 'Path not allowed: .../tests/lib/testcase.php' when trying
to run your unit tests.
There are two solutions to this, the recommended way is to use
ownCloud's test bootstrap (tests/bootstrap.php), which correctly
initializes the autoloader and sets up other useful variables besides.
Alternatively, if you use your own bootstrap, simply call
\OC::$loader->addValidRoot(\OC::$SERVERROOT . '/tests');
before using any test classes.
The documentation at
https://doc.owncloud.org/server/8.2/developer_manual/app/testing.html
has been updated with the first method, and an issue is open to
implement support in ocdev: https://github.com/owncloud/ocdev/issues/38
Happy testing!
Robin McCorkell
_______________________________________________
Devel mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/devel