mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2657: "Call to a member function bindValue() on a non-object" error when unittesting repository #3334
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Sep 6, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user arron:
When trying to test repository, after creating all mocks wit the help of OrmTestCase, I run into error "Call to a member function bindValue() on a non-object". It is caused by empty method prepare() in DriverConnectionMock. This method returns nothing and introducing NULL value on which bindValue() method is called later. Possible solution is to return new instance of StatementMock() class from prepare() method.
@doctrinebot commented on GitHub (Sep 8, 2013):
Comment created by @beberlei:
The OrmTestCase and the mocks in the Doctrine Test code is not for reuse.
@doctrinebot commented on GitHub (Sep 8, 2013):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Sep 8, 2013):
Comment created by arron:
Is there any recommendation how to create unit tests for entity repository then?