It would help to see your full test case, but I assume you're doing the following:
- Fetching the object via the document manager service in your test case
- Simulating a form submission using the HTTP test client (see: here)
- Fetching the object via the document manager again
Since changes are showing up in the database, it's safe to assume that the form is properly binding and your controller is properly flushing the changes. Assuming the form submission happens within its own kernel context, the document manager it uses internally is not the same instance as the document manager you're using explicitly in your test case.
If you're doing an initial fetch before the document is modified, your document manager will not be aware of any changes made to the document elsewhere unless you refresh()
the document or clear()
the document manager of all managed documents before re-querying. The detaching documentation explains this a bit more.
If the bullets above correctly describe your test case, I would suggest clearing the document manager before re-querying and asserting the result. Alternatively, you could probably change the test to avoid querying at all before simulating the form submission. Any test fixtures you're using can likely be abstracted out of the test case itself (e.g. inserted during a setUp()
method, after which you clear the document manager).