Codeception / module-db

DB module for Codeception
MIT License
23 stars 24 forks source link

[TypeError] Return value of Codeception\Lib\Driver\Db::lastInsertId() must be of the type string, bool returned #49

Closed szhajdu closed 9 months ago

szhajdu commented 1 year ago

Based on PDO documentation lastInsertId can be string|false, but Codeception\Lib\Driver\Db::lastInsertId has a string return value, so tables without auto increment field could fail with type error. Tried to upgrade using MS SQL Server in my tests.

Probably a simple cast to string could solve the issue, but not sure if it has any implications on other code.