Z
Z
zbender2014-01-15 09:28:50
Unit testing
zbender, 2014-01-15 09:28:50

What is the order in which PHPUnit tests are run?

The PHPUnit class has a test dependency.

public function test1(){
...
}

/**
* @depends test1
*/
public function test2(){
...
}

/**
* @depends test1
*/
public function test3(){
...
}

When a test is run, it is executed in the following sequence: test3, test1, test2. Because test3 depends on test1 (and it's not executed yet) - test3 is skipped.
I don’t understand why such an execution sequence and how to set it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Trrrrr, 2014-01-15
@Trrrrr

In general, tests should be independent.
Is there any way to change the code to avoid this problem?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question