Paul Voss
Paul Voss

Reputation: 765

How to unittest symfony2 core

After a fresh symfony2 install i can run phpunit -c app/ and phpunit tests the included demo application: OK (1 test, 1 assertion).

But i receive no output (even with verbosity) when i run phpunit -c vendor/symfony/ as described here: http://symfony.com/doc/2.0/contributing/code/tests.html.

Does anyone know how to make this work?

Testing twig, doctrine and other plugins works as expected (although doctrine tests fail for some reason).

Upvotes: 1

Views: 870

Answers (2)

Alessandro Desantis
Alessandro Desantis

Reputation: 14343

Are you running the tests using the provided phpunit.xml.dist configuration file?

From your projects root directory:

$ phpunit --configuration app/phpunit.xml.dist vendor/symfony/tests

That should add an autoloader for vendors.

Upvotes: 0

Herzult
Herzult

Reputation: 3419

If you have no output it's maybe because you configured php not to display errors.

You must install the vendors using the vendors.php script before lauching the Symfony test suite:

$ php vendor/symfony/vendors.php

Upvotes: 2

Related Questions