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

DBH Call to a member function execute() on boolean #3116

Closed
rogoit opened this issue May 20, 2016 · 8 comments
Closed

DBH Call to a member function execute() on boolean #3116

rogoit opened this issue May 20, 2016 · 8 comments

Comments

@rogoit
Copy link

@rogoit rogoit commented May 20, 2016

Hi,

i got this bug. Can anybody help please ;)

Call to a member function execute() on boolean in /projectpath/vendor/codeception/codeception/src/Codeception/Module/Dbh.php on line 121

See you
Roland

@tomtomsen
Copy link

@tomtomsen tomtomsen commented May 20, 2016

I think:

it seems like you are generating an invalid query. probably in the criteria parameter of seeInDatabase or dontSeeInDatabase.
But you are right the result of ->prepare($query) should be validated and a different error should get generated.

it seems like Dbh module is deprectated and will be removed in 2.2. so i'm not sure if that fix is relevant?

@tomtomsen
Copy link

@tomtomsen tomtomsen commented May 20, 2016

maybe running codeception with the "-vvv" parameter could help you find the error.

@rogoit
Copy link
Author

@rogoit rogoit commented May 20, 2016

So maybe you can tell me how i can get all datasets with a where statement and not only one...that is my problem to do a simple request on the database

@tomtomsen
Copy link

@tomtomsen tomtomsen commented May 20, 2016

I'm not sure what you are trying to accomplish. can you explain what you are trying to test?
which method are you using, and how?

@DavertMik: what are the default-parameter in https://github.com/Codeception/Codeception/blob/2.1/src/Codeception/Module/Dbh.php#L102 and https://github.com/Codeception/Codeception/blob/2.1/src/Codeception/Module/Dbh.php#L95 used for? doesn't they produce an invalid query? (like "select count(*) from [table] where") required because of the DbInterface
if criteria is empty, the where part should be removed

@rogoit
Copy link
Author

@rogoit rogoit commented May 20, 2016

Hi,

sure i do an Api Test. I want to read the parameters from an table. Than i will do the api call with this params in a loop and check the response.

Thx

@raistlin
Copy link
Member

@raistlin raistlin commented May 20, 2016

Can you post your test here?

@rogoit
Copy link
Author

@rogoit rogoit commented May 20, 2016

I throw it away but when i use grapFromDatabase i will not get all datasets...like where status = 1...

raistlin added a commit to raistlin/Codeception that referenced this issue May 20, 2016
raistlin added a commit to raistlin/Codeception that referenced this issue May 20, 2016
@raistlin
Copy link
Member

@raistlin raistlin commented May 20, 2016

Thanks @rogoit for reporting, even if it's deprecated, bug fixes are relevant.
Thanks @tomtomsen for research.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.