Tagged Questions
1
vote
1answer
18 views
symfony 2 and phpunit crawler client does not reach ngnix
I have written this simple test:
<?php
namespace Hello\ApiBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class HelloControllerTest extends WebTestCase {
public ...
0
votes
1answer
244 views
Testing Symfony2 Forms causes Could not load type “entity”
I am testing a Form Type I defined for an application. During testing the form type, using symfony's TypeTestCase class a message "Could not load type "entity"" appears. What can I do to solve the ...
0
votes
1answer
13 views
Symfony + Doctrine functional database testing
I found only a few lines about database functional testing in the documentation: http://symfony.com/doc/current/cookbook/testing/database.html
The problem is:
I need to install database schema from ...
0
votes
2answers
38 views
Does phpunit use a different php.ini file than the one configured in MAMP?
I'm trying to run some functional tests using phpunit in Symfony2.
When I run my test, I get this error:
PDO::__construct(): [2002] No such file or directory (trying to connect via ...
0
votes
2answers
119 views
Error trying to select a form from symfony2 crawler?
I keep getting the following error:
There was 1 error:
1) Caremonk\MainSiteBundle\Tests\Controller\SecurityControllerFunctionalTest::testIndex
InvalidArgumentException: The current node list is ...
2
votes
2answers
34 views
How to create tests w/Doctrine entities without persisting them (how to set id)
I'm working on tests for a Symfony2 project, and right now I'm looking for a way to create tests involving entity objects without persisting them. The problem is: id is a private field and there is no ...
2
votes
1answer
67 views
How to test update action?
I am trying to test my updateAction which allows to update my users in database but I don't know how I can test it... I have succed to test my createAction which add an user in my database. So I would ...
0
votes
1answer
495 views
PhpUnit failing in PhpStorm w/ exit code 255 in Symfony 2 project
I'm having trouble getting phpunit working inside of a Symfony project in PhpStorm - phpunit -c app works fine in the OSX terminal.
Here is the error:
Unable to attach test reporter to test ...
0
votes
0answers
32 views
PHPunit uses 50% more memory in Symfony 2.3.5 than in 2.3.3
Today I've updated from Symfony 2.3.3 to 2.3.5 and I noticed that the memory used when running PHPunit has increased a lot.
In 2.3.3: Time: 06:49, Memory: 92.25Mb
In 2.3.5: Time: 06:50, Memory: ...
0
votes
1answer
48 views
Mocking formbuilder with phpunit in symfony
So trying to write unit tests against my Symfony controller, and hit this snag.
My controller method returns a form, I'd like to check the values in that form to make sure it's as expected.
I ...
3
votes
1answer
106 views
How to log in User in Session within a Functional Test in Symfony 2.3?
I have read many posts on stackoverflow about this. But most of the methods not useful in Symfony 2.3.
So i have try to log in user manualy in test to make some actions in back-end.
Here is my ...
1
vote
1answer
66 views
Sending a POST request with PHPUnit
I have a symfony website, and Im trying to do some unit testing. I have this kind of test where I try to submit something:
<?php
namespace Acme\AcmeBundle\Tests\Controller;
use ...
1
vote
1answer
52 views
Symfony2 - reset envirnonment based on PHPUnit configuration
I am trying to set up two specific PHPUnit test environments for Symfony2.
I am using Ant to run PHPUnit, so when I run the two commands below I would expect the following results:
ant test
Runs ...
0
votes
0answers
13 views
Can't set form value on a functional test
I'm currently doing this tutorial: http://tutorial.symblog.co.uk/docs/testing-unit-and-functional-phpunit.html I'm at the "Test contact page" part.
There we have defined a test called testContact() ...
0
votes
2answers
175 views
Install PHPUNIT with Composer
I have project on Symfony 2 and i would like use PHPUNIT on Windows 7.
On githut phpunit is:
Composer
Simply add a dependency on phpunit/phpunit to your project's composer.json file if you use ...