phpunit-test-runner
phpunit-test-runner copied to clipboard
drop test tables on cleanup
Fixes #110
Adds functionality to remove test tables from the database during cleanup.
Thanks much for the PR!
I took a look, and I think this wouldn't work as expected when the database is only accessible from the test environment (when the test environment is not the same as the prepare one).
You can see an example in cleanup.php of how it's done for removing files.
Maybe something similar to that would work?
Hey @getsource , sure yeah, that's why I mentioned it in the issue comment since I'm only working locally :D .
If mysql is in general accessible everywhere ( since we're either way using shell_exec and other direct cli access as well ) we can go for oneliners like mysql -u $user -p$pass $db -e "drop table if exists $table;" and just iterate with that as a direct shell (and overssh) command.
This would work both locally and remotely I suppose.
Ah, sorry, I missed the issue comment!
Yes, I think something like that makes sense. The only thing that comes to mind is that I think that would result in the MySQL password being stored in logs.