-
Notifications
You must be signed in to change notification settings - Fork 16
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
initial changes to support unit testing via phpunit #911
initial changes to support unit testing via phpunit #911
Conversation
…t for retrieving accounts via account id using a mock mysql object
…ields when retrieving account. initial attempt at getting travis to run unit tests
… integration tests with database. added travis config for launching test test mysql instance in order to run integration tests. no clue if it's gonna work yet, though
I'm coming around to your idea of parsing |
…s a test, and fails with a warning that there are no test functions in the file.
Yeah I think you could make that work. Like we discussed earlier, I would just make sure that it doesn't actually read them into the environment for security. |
I see some Scrutinizer warnings along the lines of:
Obviously we don't want to compromise our method typehints for the sake of the test infrastructure, but is there a recommended way to address this sort of issue, or is a linter like Scrutinizer always going to have a problem with test code like this? Some quick googling shows discussions about issues that look similar to me, but it seems like it requires a nuanced understanding of PHPUnit, which I currently don't have! |
Let me look into this -- The object passed is not strictly of the type being mocked, but rather a proxy. I don't think that it compromises the typehint integrity in such a way that would affect production code, but it is a little annoying to see that the types returned from Mockery are not statically typed. However, to be fair, PHP is not a statically typed language, so this sort of makes sense. Standard |
…hould get rid of any type hinting warnings from scrutinizer.
Ok, I've updated the tests to use the |
There is a simple test for retrieving accounts via account id using a mock mysql object
closes #910