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

Fix validation of 'git' and 'files' options #20

Merged
merged 3 commits into from
Oct 28, 2015

Conversation

MontealegreLuis
Copy link
Contributor

I found an issue when running the analyzer the following way:

$ bin/phpqa analyze

I got a warning Undefined offset: 0, due to the logic around explode for the files option, followed by the expected exception You must set 'files' or 'git' options..

I moved the validation and normalizing of the files option to its own class with its corresponding tests.

I also added integration tests for the AnalyzeCommand that verify the git and files validation logic I changed.

One thing I noticed is that currently it is not possible to write tests for the command without modifying your src or whatever folder you pass to the test. It might be a good idea to create Analyzer objects and inject them to the app in order to make them testable or create a folder for testing with fixture files.

jmolivas added a commit that referenced this pull request Oct 28, 2015
Fix validation of 'git' and 'files' options
@jmolivas jmolivas merged commit c981e06 into jmolivas:master Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants