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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment
Hide comment
@tomtomsen

tomtomsen 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 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

This comment has been minimized.

Show comment
Hide comment
@tomtomsen

tomtomsen May 20, 2016

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

tomtomsen commented May 20, 2016

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

@rogoit

This comment has been minimized.

Show comment
Hide comment
@rogoit

rogoit 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

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

This comment has been minimized.

Show comment
Hide comment
@tomtomsen

tomtomsen 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

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

This comment has been minimized.

Show comment
Hide comment
@rogoit

rogoit 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

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

This comment has been minimized.

Show comment
Hide comment
@raistlin

raistlin May 20, 2016

Member

Can you post your test here?

Member

raistlin commented May 20, 2016

Can you post your test here?

@rogoit

This comment has been minimized.

Show comment
Hide comment
@rogoit

rogoit May 20, 2016

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

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

This comment has been minimized.

Show comment
Hide comment
@raistlin

raistlin May 20, 2016

Member

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

Member

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