DDC-2657: "Call to a member function bindValue() on a non-object" error when unittesting repository #3393

Closed
doctrinebot opened this Issue Sep 6, 2013 · 3 comments

2 participants

@doctrinebot

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

Comment created by @beberlei:

The OrmTestCase and the mocks in the Doctrine Test code is not for reuse.

@doctrinebot

Issue was closed with resolution "Invalid"

@doctrinebot

Comment created by arron:

Is there any recommendation how to create unit tests for entity repository then?

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment