Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of file_get_contents everywhere, also in tests #9269

Closed
tassoman opened this issue Nov 24, 2015 · 5 comments
Closed

Get rid of file_get_contents everywhere, also in tests #9269

tassoman opened this issue Nov 24, 2015 · 5 comments
Labels
answered For when a question was asked and we referred to forum or answered it. c: Tests & QA For issues related to automated tests or making it easier to QA & test issues.

Comments

@tassoman
Copy link
Contributor

There still many portions of code using file_get_contents(), running tests using Proxy behind my company's firewall gives me back warnings. ⚠️

This function ignores proxy configuration, I think shouldn't be used no more because storically there are plenty of issues against it 😨

This is a minor Issue because outputs only warnings in console (tests skipped, I suppose). It happens also if you try to write your own IntegrationTests while developing plugins.

@mattab
Copy link
Member

mattab commented Nov 25, 2015

👍 we should use our Http::sendRequest method instead (which uses the configured proxy). @tassoman a pull request would be very welcome!

@mattab mattab added the c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. label Nov 25, 2015
@mattab mattab added this to the Short term milestone Nov 25, 2015
@tassoman
Copy link
Contributor Author

I'll do my best! Looks like I can do it 🏄

@tassoman
Copy link
Contributor Author

Well, looking deeper looks like file_get_contents in tests is correctly used for fetching inside local file system. So doing a Http::sendHttpRequest($thing, $timeout) here is wrong.
This issue looks like a nevermind thing.

But my doubt still here, the question is: why while I'm running my plugin's Unit Tests, Piwik's console Runs also Referers Plugin's unit tests looking for missing file /home/systemuser/path/to/piwik/vendor/piwik/searchengine-and-social-list/SearchEngines.yml ?

@mattab
Copy link
Member

mattab commented Nov 27, 2015

@tassoman you need to run composer install to remove this error

@tassoman
Copy link
Contributor Author

Crazy! I forgot running composer update, do you think would be useful adding a check in the console command while it's in developer mode?

That check could manage local composer's update timestamp displaying a CLI warning message if it feels composer not enough updated ...

Or it's simply the best practice 📗 starting each day with:

$ composer selfupdate
$ composer global update
$ composer update

😄

@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. c: Tests & QA For issues related to automated tests or making it easier to QA & test issues.
Projects
None yet
Development

No branches or pull requests

2 participants