@after

@after

The @after annotation can be used to specify methods that should be called after each test method in a test case class.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use PHPUnit\Framework\TestCase;
 
class MyTest extends TestCase
{
    /**
     * @after
     */
    public function tearDownSomeFixtures()
    {
        // ...
    }
 
    /**
     * @after
     */
    public function tearDownSomeOtherFixtures()
    {
        // ...
    }
}
doc_PHPUnit
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.