0
votes
1answer
18 views

Warning: require_once(PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 49

This is my complete error message: Warning: require_once(PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 49 Fatal error: require_once(): Failed ...
2
votes
0answers
18 views

Test access_control in Symfony2

I want to test that my access_control is working as expected, that certain roles don't have access to a page while other roles do. I can do this using Functional Tests, logging in each user and ...
5
votes
1answer
56 views

Class __PHP_Incomplete_Class has no unserializer

I am trying to run the tests in PHPUnit and getting this error. Fatal error: Uncaught exception 'ErrorException' with message 'Class __PHP_Incomplete_Class has no unserializer' in ...
4
votes
1answer
49 views

PDO connection is not closed when phpunit is running with symfony 2.X

We have about 180 unit tests implement webtestcase class and tests are running over controllers. However when we run the unit tests, they open too many connection to db. Because of too many active ...
2
votes
1answer
28 views

Symfony2 UnitTests fail at first run, succeeds on all subsequent runs

When I run phpunit on my Symfony2 project, the tests always fail at first run: $ phpunit -c app src/Project/MyBundle/Tests/Controller/SomeTest.php PHPUnit 3.7.19 by Sebastian Bergmann. ...
1
vote
2answers
24 views

Symfony 2 Service Error on unit Testing

I make some functional test with Symfony 2 and phpunit. But i've some trouble with a Service. Let me explain. During my run test, i want to use some service used by the application. So i juste set my ...
1
vote
1answer
29 views

accessing entity manager inside phpunittest

I have the following unit test code in symfony: <?php // src/Acme/DemoBundle/Tests/Utility/CalculatorTest.php namespace Shopious\MainBundle\Tests; class ShippingCostTest extends ...
0
votes
1answer
60 views

codeception symfony2 unit test throws a fatal error

using the classical phpunit style I generate:test with the symfony2 helper. I can get the service and I can assert it ok. // tests public function testGetServiceUrl() { $ecservice = ...
0
votes
1answer
21 views

Using Codeception, Symfony2 Functional Testing a service how do I add assertions?

Summary: I want to use Module assertions in my Tests. Previously I have tested Symfony2 services using PHPUnit tests. This is ok but I would like to use some of the facilities that the Codeception ...
0
votes
1answer
35 views

Get proper installation of PHPUnit Database extension in Symfony2

I've been struggling with my configuration for 2 days now. When I launch phpunit from my bash emulator (working under windows 7) bin/phpunit -c app I got the following error: Configuration ...
0
votes
3answers
35 views

Symfony 2 functional test: authenticate user of own User class

As described in answer of How to use an authenticated user in a Symfony2 functional test? there is a simple solution with Symfony\Component\Security\Core\User\User. But I have different User class ...
0
votes
0answers
33 views

Symfony 2 SessionCsrfProvider & PHPUnit testing

EDIT actually answered this myself, was so simple: $session = $this->getMock( '\Symfony\Component\HttpFoundation\Session\Session', array(), array(), '', false // don't call constructor ...
0
votes
1answer
43 views

“You cannot define a mapping item when in a sequence” when running phpunit in symfony

I'm getting the following errors when I try to run phpunit on my symfony project: $ phpunit -c app 1) [...]\DefaultControllerTest::testIndex ...
1
vote
1answer
67 views

Proper way to test a Symfony2 Service with Doctrine

I'm struggling to find the correct way to unit test my symfony 2 services which use doctrine or other common services. What i have done so far: In my understanding the controller actions should: ...
0
votes
0answers
50 views

PHPUnit 3.7.19 and Symfony2 broken tests

I'm developing some test for a Symfony2.0 project and running them with PHPUnit. On my PC works fine but trying them in other environments the tests fails. I thought the problem was php version but ...

1 2 3 4 5 11
15 30 50 per page