Reputation: 1702
If you follow the advice at the F3 site for setting up unit testing it fails. The example steps you through creating a file with F3 tests and says to save it in the root as test.php. So the url would be http://localhost/test.php
. Well... this will never work because the router chokes on it. Where do I put it? What would I put in the router index.php file? Perhaps I'm tired or just stupid right now, but I don't see how to run this test.php file.
Thanks a lot for you help.
Upvotes: 1
Views: 419
Reputation: 4690
I recommend to check out the dev branch of F3.
https://github.com/bcosca/fatfree/tree/dev
It consists of the latest code and a whole bunch of unit tests (see the app
folder). The thing about the docs is: they're not 100% up to date and the example about unit tests doesn't work with routes. It's just pure PHP to test your app's functions by calling the test.php
which tests the code of hello.php
If your router really tries to look for test.php
in its routes, then you have to fix your rewrite rules, because you missed to exclude existing files and folders. Here's the snippet for Apache.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
Upvotes: 1