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
2
votes
1 answer

Error when using YEAR, MONTH, DAY mysql functions in LiipFunctionalTest bundle

I'm using DAY, MONTH, YEAR mysql's functions (http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_year) with LiipFunctionalTestBundle. When I run the test I'm getting: SQLSTATE[HY000]: General error: 1 no such function:…
2
votes
2 answers

Symfony2 tests: Issue with fixtures and foreign keys

I'm developing a project with Symfony and Doctrine and I have an issue with my tests. I'm using Fixtures to load data for the tests, and some of my entities have associations between them. The first time I run my tests with empty DB tables the tests…
1
vote
1 answer

Load data fixtures in setUpBeforeClass with LiipFunctionalTestBundle

As the title says, I'd like to know how to load the data fixtures in the method setUpBeforeClass. The test class extends Liip\FunctionalTestBundle\Test\WebTestCase. At the moment I have this: public function setUp() { $this->client =…
cezar
  • 11,616
  • 6
  • 48
  • 84
1
vote
2 answers

Functional Testing Symfony with mulitple Doctrine EntityManagers

In a Symfony 4 application I have configured multiple entity managers. I want my functional tests to automatically create DB tables for both managers. However, when I run my test; PHP unit encounters an error that says PDOException:…
1
vote
0 answers

Using fixtures with LiipFunctionalTestBundle and Postgresql

I'm trying to implement functional tests with Liip's FunctionalTestBundle in a legacy Symfony 2.8 project. This project uses hand-written postgresql queries in repositories and such, so I cannot force the usage of sqlite. Based on the bundle's…
1
vote
1 answer

Symfony 3 mock service in functional tests phpunit and liip

I use Symfony 3.4. I have functional tests which extend from Liip\FunctionalTestBundle\Test\WebTestCase and in some function I want mock some service, I create mockobject for service but in action I still have original service, how to mock…
shuba.ivan
  • 3,824
  • 8
  • 49
  • 121
1
vote
1 answer

Why this method get executed without being called?

According to this documentation, I can write a setUp() function in my test class, like: use Doctrine\ORM\Tools\SchemaTool; use Liip\FunctionalTestBundle\Test\WebTestCase; class AccountControllerTest extends WebTestCase { public function…
1
vote
2 answers

Conflicts with sonata admin bundle and LiipFunctionalTestBundle

when I try to install sonata admin and LiipFunctionalTestBundle, it gives me a validator problem, FileLoaderLoadException: Catchable Fatal Error: Argument 1 passed to Sonata\AdminBundle\Admin\Admin::setValidator() must implement interface…
anony
  • 185
  • 2
  • 14
1
vote
0 answers

symfony "Cannot set session ID after the session has started" while testing

I'm using symfony 2.8.3 together with fosuserbundle, liipfunctionalTestBundle and HWIOAuthBundle. My test code $client = static::makeClient(true); // request of any other url is getting the same error $crawler = $client->request('GET',…
Victor Bredihin
  • 2,220
  • 21
  • 30
1
vote
0 answers

Symfony functional testing using two databases

I'm using liip-functional-test bundle for functional testing my application. I configured a test database in the config_test.php file: doctrine: dbal: default_connection: default connections: default: …
1
vote
1 answer

Symfony LiipFunctionalTestBundle loadFixtures duplicate entry

I'm struggling again with the Liip/LiipFunctionalTestBundle in Symfony v2.7. I have two tests, which do nothing but load fixtures via this bundle. If I load the same fixture class in both classes, the second one tries to commit his fixtures twice!…
user3557131
1
vote
1 answer

Functional test: sqlite does not include soundex()

Attempts to build a functional test where soundex() is required fail due to the fact that the function by default is not compiled in pdo_sqlite. Functional tests are being built using LiipFunctionalTestBundle. The error reported is: PDOException:…
geoB
  • 4,578
  • 5
  • 37
  • 70
1
vote
1 answer

Functional test fails although content exists

In the functional test below, the assertion that the text 'Glenshire' exists fails even though the output of echo $client->getResponse()->getContent(); includes
  • Glenshire... The first two assertions are true. There is no redirect. The…
  • geoB
    • 4,578
    • 5
    • 37
    • 70
    0
    votes
    1 answer

    Symfony 5.0 LiipFunctionalTestBundle Form must be an instance of Client instead of KernelBrowser

    I upgrade my project to Symfony 5.0. However, when running tests I get the following error: TypeError: Argument 1 passed to App\Tests\PagesTestCase::form() must be an instance of Symfony\Bundle\FrameworkBundle\Client, instance of…
    Karis Ashton
    • 65
    • 1
    • 7
    0
    votes
    2 answers

    Symfony2 with LiipFunctionalTestBundle error when i load fixture

    i've installed LiipFunctionalTestBundle and try to use it since yesterday but i've got an error and i don't know how to solve it. I use the basic configuration as describe in the documentation(config_test) : framework: test: ~ session: …
    Epok
    • 661
    • 1
    • 8
    • 16
    1
    2