0

I am using Symfony 1.4
Used phpunit function test

<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');

$browser = new sfTestFunctional(new sfBrowser());

$browser->
  get('/api/v2/membership/membershipDetails')->

  with('request')->begin()->
    isParameter('module', 'api')->
    isParameter('action', 'apiRequest')->
  end()->

  with('response')->begin()->
    isStatusCode(200)->
  end()
;

It is expected to give output like

ok 1 - request parameter module is api
ok 2 - request parameter action is apiRequest
ok 3 - status code is 200
1..3
# Looks like everything went fine.

but my code giving API response as output-

    # get /api/v2/membership/membershipDetails
    {"responseStatusCode":"1","responseMessage":"Something went wrong. Please try again later.","AUTHCHECKSUM":null,"hamburgerDetails":null,"phoneDetails":null}
# Looks like everything went fine.

I tried to change some symfony files and found-

lib/vendor/symfony/utils/sfBrowser.class.php<br>
line #44  -  $this->context->getController()->dispatch();


echo die before this line is working, but just after this line echo die not working.
SomeWhere die is used in this function, which i am unable to find out. Please help in this regards.

Akash Kumar
  • 642
  • 7
  • 20
  • 1
    return hovenever a 200 http status code? PS: The testing framework of sf1.4 is called lime not phpunit – Matteo Feb 26 '15 at 10:08
  • when i comment line mentioned above, I get correct output with 200 Status code otherwise i get RESPONSE PRINTED and exit. BUT on commenting above line - getContent() do not works. i.e. file content is not fetched – Akash Kumar Feb 26 '15 at 10:19

0 Answers0