Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8377101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:34:46+00:00 2026-06-09T15:34:46+00:00

I’m trying to write some functional tests in Symfony2 with MongoDB, but I can’t

  • 0

I’m trying to write some functional tests in Symfony2 with MongoDB, but I can’t figure out the problem that I am having. In test I edit an object via form, and than fetch it with the document manager, but I keep getting unchanged data. If I look into DB, the data is properly changed.

What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:34:47+00:00Added an answer on June 9, 2026 at 3:34 pm

    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).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I know there's a lot of other questions out there that deal with this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.