Questions tagged [liipfunctionaltestbundle]

Symfony Bundle with helper classes for writing functional tests

This Bundle provides base classes for functional tests to assist in setting up test-databases and HTML5 validation. It also provides a Dependency Injection aware mock builder for unit tests.

With version 3, fixtures loading was moved to another project.

Official repository

30 questions
7
votes
2 answers

How to Use Behat with Liip\FunctionalTestBundle in Symfony2?

I'm using Liip\FunctionalTestBundle for Unit testing, it works very well. AppCategoryControllerTest.php: class AppCategoryControllerTest extends BoEditoAuthWebTestCase { public function setUp() { parent::setUp(); // It…
Bopi
  • 71
  • 2
7
votes
6 answers

Get content of email sent during command tests

During my tests I call some commands which send emails. I can display the number of emails sent with the following command: $output->writeln( $spool->flushQueue( $this->getContainer()->get('swiftmailer.transport.real') ) ); The…
A.L
  • 10,259
  • 10
  • 67
  • 98
5
votes
1 answer

Symfony2 LiipFunctionalTestBundle overriding @validator service

I am trying to inject @validator into my service but LiipFunctionalTestBundle is overriding that service when it gets injected. admin.image_service: class: AdminBundle\Service\ImageService arguments: ["@validator",…
danwoodbury
  • 311
  • 1
  • 11
4
votes
4 answers

I want to integrate getContainer() in WebTestCase

use Liip\FunctionalTestBundle\Test\WebTestCase; class ControllerTest extends WebTestCase { public function testSuccess() { $url = $this->getContainer()->get('router') ->generate('name_route', array('parameter' => '…
4
votes
2 answers

Symfony2 functional test Unreachable field "_token"

I am creating a functional test in Symfony using the Liip functional test bundle. I am currently stuck on submiting an form. I am trying to add a new 'log' using the functional test. If I try to add a new log trough the UI I get the following…
Szenis
  • 4,020
  • 2
  • 21
  • 34
4
votes
1 answer

Independent functional tests with LiipFunctionalTestBundle and fixtures?

I'm adding tests to a Symfony2 project. Previously I used the same database for dev and test environments, it used a MySQL database already populated with the same data than on the production server. The tests were working dependently because some…
A.L
  • 10,259
  • 10
  • 67
  • 98
4
votes
3 answers

Testing database insert using Symfony

Good day everyone, I have been looking into Test Driven Development a lot in the past few days and decided that I need to learn it as well. Although I can not figure out how to do it precisely. My project depends on the Symfony2.1.6 framework and…
3
votes
3 answers

How to pass bearer token to test API using phpunit and Liip

this is what I am doing I make a first call to get the token $client->request('POST', '/api/login_check', [], [], ['CONTENT_TYPE' => 'application/json'], json_encode( [ "username" => $user->getUsername(), …
user3174311
  • 1,714
  • 5
  • 28
  • 66
3
votes
2 answers

How to append fixtures in liip functional test (symfony 2.8)?

I would like to append fixtures in my functional test (based on LiipFunctionalTestBundle in symfony 2.8. Even it is a dev database I working on, I do still need to append the fixtures since I will have: regional data (country, region,…
3
votes
2 answers

Parallelize functional tests while using a SQLite database

I have added many tests in my Symfony2 project, but now with 53 tests and 176 assertions it takes about a minute. I'm trying to reduce this time because if I enable code coverage report it takes 15 minutes. $ phpunit -c app/phpunit.xml.dist PHPUnit…
A.L
  • 10,259
  • 10
  • 67
  • 98
3
votes
1 answer

html5 checker compilation

I would like to use html5 validator from LiipFunctionalTestBundle in my Symfony2 project. So, I followed instructions on bundle's github page, but I got this error during python build: IOError: [Errno 2] No such file or directory:…
Massimiliano Arione
  • 2,422
  • 19
  • 40
2
votes
1 answer

How to set some data in session in functional test?

I use "liip/functional-test-bundle": "~1.8", and "symfony/symfony": "~3.4", and for my functional test I want set some data in session,but after set data in action, with the same key, I had null. Mytest class extends from extends WebTestCase this is…
shuba.ivan
  • 3,824
  • 8
  • 49
  • 121
2
votes
0 answers

Application parameter not found in test env

I'm using LiipFunctionalTestBundle with AliceBundle to test my Symfony 3.4 application with fixtures. Everything is working fine but this specific case: Accessing application parameters from within a fixture loaded from a test in a Liip WebTestCase…
Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307
2
votes
1 answer

How can I populate/imitate server variables in PHPUnit Test cases using Symfony3?

How can I populate/imitate server variables in PHPUnit Test cases using Symfony3? I try to create functional tests for my symfony3 application. I use LiipFunctionalTestBundle. I have a special $_SERVER variable which contains the country of the…
2
votes
1 answer

Liip\FunctionalTestBundle\Test\WebTestCase' not found in C:\wamp\www\test\src\TestTask\PhotosBundle\Tests\Controller\ApiControllerTest.php

When I run the command php ApiControllerTest.php, it shows me this error: Liip\FunctionalTestBundle\Test\WebTestCase' not found in C:\wamp\www\test\src\TestTask\PhotosBundle\Tests\Controller\ApiControllerTest.php on line 12 My composer is as…
anony
  • 185
  • 2
  • 14
1
2