Symfony2 Functional Testing $crawler Not Working

后端 未结 1 1384
迷失自我
迷失自我 2021-01-13 14:04

I have found that the functional tests in Symfony2 always try to request pages as \"http://localhost\"

My environment is setup with virtual hosts so I have my applic

相关标签:
1条回答
  • 2021-01-13 14:57

    I found that I can pass the domain in to the Client. I will just make a base WebTestCase with this functionality so my tests work.

    $client = static::createClient(array(), array('HTTP_HOST' => 'symfony.dev'));
    $client->followRedirects(true);
    
    0 讨论(0)
提交回复
热议问题