Answer the question
In order to leave comments, you need to log in
Reset the state of the database before the test?
Hello! Faced such a problem.
Tests change values in the database, and fixtures are rolled only once. Because of this, in some tests, I get the wrong values that I expect - due to the fact that some other test changed the value in the table.
How to roll fixtures before each test?
Answer the question
In order to leave comments, you need to log in
Use phpunit database extension (PHPUnit_Extensions_Database_TestCase).
The DB will be set (data) from the fixtures for each test.
Look for a description of Continuous Integration for Yii.
Here is an example: Continuous Integration Part I
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question