1
WebTestCase의 크롤러를 문자열에 사용하는 방법이 있습니까? 내가 WebTestCase를 사용하여 테스트를 할 것인지 일반적으로는, 내가 클라이언트 사용하여 다음과 같이 할 것입니다 : 이제WebTestCase : 크롤러를 사용하여 문자열 테스트
public function testInitialPage()
{
$client = $this->createClient();
$crawler = $client->request('GET', '/');
$this->assertCount(1, $crawler->filter('h1:contains("Contact us")'));
...
}
을, 나는 어떻게 든 문자열에 크롤러를 사용하는 것이 가능하다 알고 싶다 그래서 아래와 같이 될 수 있습니다 :
public function testInitialPage()
{
...
$crawler = Crawler::createCrawler("<h1>Contact us</h1>");
$this->assertCount(1, $crawler->filter('h1:contains("Contact us")'));
...
}
고마워요!