Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assetic and functional testing #223

Open
Elexy opened this issue Apr 24, 2012 · 0 comments
Open

assetic and functional testing #223

Elexy opened this issue Apr 24, 2012 · 0 comments

Comments

@Elexy
Copy link

Elexy commented Apr 24, 2012

Trying to test a Symfony2 page that runs fine in the browser (dev and prod)
When trying to run functional tests like described in the manual i get:

string(49618) " An exception has been thrown during the rendering of a template ("Rou te "_assetic_2875553_0" does not exist.") in "ProjectXFrontendBundle::layout.html.twig" at line 6. (500 Internal Server Error)

The number is correct, but the generated files are called:
2875553_part_1_base_1 etc...

I'm using SF 2.0.12

Any ideas anyone?

test code:

public function testIndex()
   {
      $client = static::createClient();

      $crawler = $client->request('GET', '/');
      var_dump($crawler->text()); //debug
      $this->assertTrue($crawler->filter('html:contains("Benefits")')->count() > 0, "assert text <benefits>");
      $this->assertTrue($crawler->filter('a:contains("Login")')->count() > 0, "Login found on page");
      $link = $crawler->selectLink("Login")->link();
      $this->assertTrue((bool) $link);
      $crawler = $client->click($link);
      $this->assertTrue($crawler->filter('html:contains("Remember me")')->count() > 0);
   }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant