Writing Tests for PHPUnit
Writing Tests for PHPUnit
Example 2.1 shows how we can write tests using PHPUnit that exercise PHP's array operations. The example introduces the basic conventions and steps for writing tests with PHPUnit:
The tests for a class
Class
go into a classClassTest
.ClassTest
inherits (most of the time) fromPHPUnit\Framework\TestCase
.-
The tests are public methods that are named
test*
.Alternatively, you can use the
登录查看完整内容