-
Notifications
You must be signed in to change notification settings - Fork 64
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
add info about git and default directory #43
add info about git and default directory #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @benharold, thank you so much for your contribution! You found an edge case in the phpqa generate
command. I just opened an issue about it and I will work on it.
docs/_tutorials/phpqa-tutorial.md
Outdated
|
||
The `phpqa` tool expects you to be operating in the context of a `git` | ||
repository. So before continuing, you'll want to decide where you'll be storing | ||
your test files, and create a `git` repo in that directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need a git
repository. You can store your .phpt
files anywhere in your system. For example, you can simply create a .phpt
file in your $HOME folder and run phpqa run $HOME/your_test.phpt
and it should work. If this is not working as expected for you could you please open an issue at the docker-phpqa repository? I just opened one about the phpqa generate command, but please feel free to add more info there or open any other issue if you think that you are facing something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I should have been more specific. This is related to the phpqa generate
command, not the phpqa run
command.
docs/_tutorials/phpqa-tutorial.md
Outdated
It is also important that you have a `phpt/` directory within that repo. | ||
By default, `phpqa` places tests that it generates in the `phpt/` directory and | ||
will throw an error if the directory does not exist. You can override this | ||
behavior as described below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Early versions of phpqa
were indeed with phpt
as default directory, but this is not required since a couple of weeks. Could you please make sure that you have the latest version of the tool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how to check the version. I ran phpqa -v
and phpqa --version
but neither gave me a version. I just installed this today from the PHP TestFest tutorial instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, the tool misses indeed a version info. Just created another issue to implement that. It will for sure help when any user needs to report a problem.
the `phpt/` directory. | ||
|
||
If you want to override the destination directory where the files are generated | ||
you can pass it as the first argument of the generate command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recommended way, for now, is to always pass the target directory. Maybe this tutorial is not clear enough about it or even we could improve a bit the API in order to consider the directory as the current one when the generate
command doesn't receive one.
Just finished a fix for the misleading error that you reported @benharold. As soon as the pull request gets approved it should solve the default directory problem for the |
Is this pull request still relevant? |
The |
While I was working through the
docker-phpqa
tutorial, I ran into a couple of gotchas. Specifically:phpqa
outside of agit
repo it throws an errorphpqa
without creating the defaultphpt/
directory, it throws an errorI've updated the tutorial to indicate these circumstances.