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

Breaking change in 3.1.1: type error in call to isBinary() #64

Closed
anomiex opened this issue Dec 1, 2023 · 4 comments · Fixed by #63
Closed

Breaking change in 3.1.1: type error in call to isBinary() #64

anomiex opened this issue Dec 1, 2023 · 4 comments · Fixed by #63

Comments

@anomiex
Copy link

anomiex commented Dec 1, 2023

The call to $this->isBinary() added in #48 broke a bunch of our tests that were passing float parameters with the following error

[TypeError] Codeception\Lib\Driver\Db::isBinary(): Argument #1 ($string) must be of type string, float given, called in /tmp/wordpress-latest/src/wp-content/plugins/crm/vendor/codeception/module-db/src/Codeception/Lib/Driver/Db.php on line 299

A fix might be to add an is_string() check before the attempt to call $this->isBinary().

CC: @cybd @Arhell @Naktibalda

@troy-rudolph
Copy link

Same problem here. We have many tests that set some column value to null. Now they all fail.

00:38:41  �[37;41;1m  [TypeError] Codeception\Lib\Driver\Db::isBinary(): Argument #1 ($string) must be of type string, null given, called in /web/manager-jenkins/jenkins-Manager-PR-17842-5/www/vendor/codeception/module-db/src/Codeception/Lib/Driver/Db.php on line 297  �[39;49;22m
00:38:41  �[37;41;1m                                                                                                                                                                                                                                                         �[39;49;22m
00:38:41  �[33m
00:38:41  Scenario Steps:
00:38:41  �[39m
00:38:41   6. $I->updateInDatabase("Tests",{"Publis...},{"TestID...}) at �[32mtests/api/observations/ObservationsFiltersCest.php:222�[39m
00:38:41   5. // I am going to update the Status for getting archived and abandoned Observations (in Tests table)
00:38:41   4. $I->grabFromDatabase("Tests","TestID",{"CourseID":40}) at �[32mtests/api/observations/ObservationsFiltersCest.php:215�[39m
00:38:41   3. $I->grabFromDatabase("Tests","TestID",{"CourseID":38}) at �[32mtests/api/observations/ObservationsFiltersCest.php:210�[39m
00:38:41   2. $I->useDataGeneratorTool({"actions":[{"action":"tun...}) at �[32mtests/api/observations/ObservationsFiltersCest.php:194�[39m
00:38:41   1. $I->getMicroStamp() at �[32mtests/api/observations/ObservationsFiltersCest.php:17�[39m
00:38:41  
00:38:41  #1  Codeception\Module\Db->updateInDatabase
00:38:41  #2  /web/manager-jenkins/jenkins-Manager-PR-17842-5/www/tests/codeception2/tests/_support/_generated/ApiTesterActions.php:4686
00:38:41  #3  /web/manager-jenkins/jenkins-Manager-PR-17842-5/www/tests/codeception2/tests/api/observations/ObservationsFiltersCest.php:222
00:38:41  #4  SM\ObservationsFiltersCest->_before
00:38:41  #5  /web/manager-jenkins/jenkins-Manager-PR-17842-5/www/vendor/bin/codecept:119
00:38:41  �[33mArtifacts:�[39m

@bigahuna
Copy link

bigahuna commented Dec 9, 2023

Same here

[TypeError] Codeception\Lib\Driver\Db::isBinary(): Argument #1 ($string) must be of type string, null given, called in /var/www/html/xyz/vendor/codeception/module-db/src/Codeception/Lib/Driver/Db.php on line 298

After running something like this

$I->updateInDatabase('users', ['enabled' => 0], ['id' => 2728]);

@troy-rudolph
Copy link

Please merge the fix: #63

@Daredzik
Copy link

Daredzik commented Jan 8, 2024

Any chances of fixing this code? We've been waiting for it for too long, over a month is too much delay for a production-ready package introducing such a big backward compatibility change.

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 a pull request may close this issue.

4 participants