Skip to content

Instantly share code, notes, and snippets.

@paddya
Created March 15, 2012 15:40
Show Gist options
  • Save paddya/2044850 to your computer and use it in GitHub Desktop.
Save paddya/2044850 to your computer and use it in GitHub Desktop.
$em = $client->getContainer()->get('doctrine')->getEntityManager();
$company = $em->getRepository('FirmaLogicBundle:User')->findOneBy(array());
$crawler = $client->request('GET', '/firma/' . $company->getSlug());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
// check if heading is correct
$this->assertEquals(1, $crawler->filterXPath('/html/body/div/div[2]/div/h2')->count());
$this->assertEquals(1, $crawler->filter('html:contains("' . $company->getName() . '")')->count());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment