Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Running PHPUnit #1555
Working on a PR and I want to run the tests, but I'm a bit confused as to how the development environment is configured.
I know the readme says not to run
I get the following error:
However just renaming that helper function seems to allow PHPUnit to run normally.
I've learnt the hard way that overriding core framework features like this always causes trouble.
Would you expect a PR that renames that helper function and it's usages within the app, and updates the readme to use the composer installed version of PHPUnit?
Yeah, I know it's a bit awkward.
Laravel does make it's helper functions override-able which would generally be fine but yeah, issues are thrown when using the composer provided phpunit. Between the phpunit options, the difference lies in how they use the composer auto-loader. The composer-provided phpunit uses the same autoloader as the BookStack app whereas a downloaded phpunit does not depend on local vendor files. The composer-provided phpunit causes the laravel helper functions to be parsed before the BookStack helper functions, therefore throwing this error.
I've been working on updating the BookStack URL system anyway, to extend the laravel URL generator so the original laravel helpers can be used as normal. I'll update the title of this and leave it open as a reminder to update the testing instructions and ensure phpunit can be ran via composer after I've made changes.