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

  • Home
  • SEARCH
  • 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 6001985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:54:46+00:00 2026-05-23T00:54:46+00:00

I am writings functional tests for my projects’ backend application modules. To test some

  • 0

I am writings functional tests for my projects’ backend application modules. To test some features, I need to simulate user actions from frontend application. So, I created 2

sfTestFunctional instances:
$frontendBrowser = new frontendTestFunctional();
$backendBrowser = new backendTestFunctional();

These classes basically inherit from sfTestFunctional. Now, as we know, each application in symfony has its own context instance, so we have to switch to it first:

sfContext::switchTo('frontend');
//this works fine
$frontendBrowser->
  get('/home');

sfContext::switchTo('backend');
//the following fails with a misirable error: Cannot redeclare class homeComponents
$backendBrowser->
  get('/home');

So, the problem is that both pages have their own classes with the same name (homeComponents) that obviously cannot be included in one script. Is there anything I can do about it?

P.S the question is not necessarily Symfony related, so I also tag it ‘php’

update: Seems like the only solution is to rename all the modules in one application, so that action and components classes have different names. But this is very involved.

  • 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-05-23T00:54:47+00:00Added an answer on May 23, 2026 at 12:54 am

    You might consider breaking the test up into two distinct tests.

    The first one runs the frontend application and then checks to make sure that the state of the database, session, etc. is correct.

    The second test will set up the test environment to mimic the results of the frontend application completing successfully and then running the backend application and checking the result.

    This will also help down the road in case regressions surface in either application; if you were to keep the tests for both applications consolidated, you would get less information from a test failure. With a separate test for each application, you will be able to find the regression more easily (since you will at least know which application is affected).

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

Sidebar

Related Questions

I'm writing a django web application, and I'm making unittests & selenium functional tests.
I am writing unit and functional tests in my Ruby on Rails application. I
I started writing functional tests for my rails app today. I use the RESTful
I'm writing some unit tests and I have a lot of functions of the
I'm writing an upload function for ColdFusion of Wheels and need to unit test
I'm always writing tests to check my controller restricts people from certain actions depending
I'm finding the feedback look pretty slow when running integration and functional tests in
We develop several products and already have extensive unit-tests and fully automated functional tests
So I've done unit testing some, and have experience writing tests, but I have
I'm writing some testing functions for a project. The test function takes a function

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.