Skip to content

Instantly share code, notes, and snippets.

@zyphlar
Created September 10, 2014 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zyphlar/e6ae7e468a55dba47993 to your computer and use it in GitHub Desktop.
Save zyphlar/e6ae7e468a55dba47993 to your computer and use it in GitHub Desktop.
phpunit test example
<?php
namespace Acme\Mybundle\Tests\Controller;
use Liip\FunctionalTestBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Session\Session;
class ControllerTest extends WebTestCase
{
public function testVmplsNew() {
$crawler = $client->request('GET', '/admin/dashboard/');
// visit account
$link = $crawler->filter('a.btn[href*="dashboard/account"]')->eq(0)->link();
$crawler = $client->click($link);
$this->assertGreaterThan(0, $crawler->filter('html:contains("My Account")')->count());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment