Symfony: multiple applications in one test

I am working on functional tests for the backend modules of my projects. To test some functions, I need to simulate user actions from an external application. So I created 2

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

These classes are mainly inherited from sfTestFunctional. Now, as we know, each application in symfony has its own context instance, so we must first switch to it:

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), which obviously cannot be included in one script. Anything I can do about it?

PS the question is not necessarily related to Symfony, so I also tag it with "php"

update: , , . .

+5
1

.

frontend, , , ..

, , - .

; , , . ( , , , ).

+1

All Articles