문제

I need to provide functional tests for a symfony 1.4 application. I've got 3 applications. Frontend (index.php) is empty and I do not test it. I want to test api and backend applications.

The default code for a functional test looks like the following:

$browser->
  get('/incomes/index')->

  with('request')->begin()->
    isParameter('module', 'incomes')->
    isParameter('action', 'index')->
  end()->

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;

The problem is that it seems to access the default application (frontend). What can I do to access another application? I've tried things like:

$browser->
  get('/api.php/incomes/index')->

but all failed. I couldn't find any info about this in the official docs...

도움이 되었습니까?

해결책

From the link you stated, I can see from test/bootstrap/functional.php that the application you try to test in your php file is guessed from its filepath.

So my guess is that your test file should be in a repertory with the name of your application. In other words, your test filepath should be in

test/functional/your_app/your_test_file

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top