Repository navigation
fix(client): default the current database to an empty name - #65
Conversation
Test doubles that extend Client without calling its constructor left the typed property uninitialised, so getDatabase() threw on them; utopia-php/database reads it when building its Mongo adapter.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Code review
The client’s database-name property now defaults to an empty string when a subclass skips the constructor, while normal construction still assigns the validated database name. The Mongo test adds coverage for Walkthrough (2)
Reviewed Tip Comment |

Follow-up to #64. Subclasses that skip the constructor (test doubles in utopia-php/database and elsewhere) left
$databaseuninitialised, so the newgetDatabase()threw anErroron them. utopia-php/database#1107 reads it when constructing the Mongo adapter, which broke those doubles. Defaulting the property to''makesgetDatabase()safe on them; real clients still always set it in the constructor, which refuses an empty name.Verification:
MongoTest::testSetDatabasenow also checks a constructor-less double returns''; the full suite passes locally (63 tests), Pint and PHPStan pass.