Browse Source

Update test-unit.md

tags/2.0.16
cuiliang 7 years ago committed by GitHub
parent
commit
98aef96969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      docs/guide-zh-CN/test-unit.md

25
docs/guide-zh-CN/test-unit.md

@ -1,25 +1,24 @@
单元测试
==========
> 注意: 这部分正在开发中。
单元测试验证了一个单元代码是否正如预期那样运行工作。 在面向对象程序设计
中,最基本的代码单元就是类。 因此,单元测试主要需要验证每个类接口方法的
正确性。也就是说,单元测试验证了方法在给定不同的输入参数的情况下,该方法
是否能够返回预期的结果。单元测试通常由编写待测试类的人开发。
单元测试验证单个代码单元是否按预期工作。 也就是说,给定不同的输入参数,
测试验证类方法返回预期结果。
单元测试通常由编写待测试类的人开发。
Yii的单元测试框架 Codeception 基于 PHPUnit,Codeception 建议遵从 PHPUnit 的文档的进行开发:
- [PHPUnit docs starting from chapter 2](http://phpunit.de/manual/current/en/writing-tests-for-phpunit.html)。
- [Codeception Unit Tests](http://codeception.com/docs/05-UnitTests)。
- [Codeception for Yii framework](http://codeception.com/for/yii)
- [Codeception Unit Tests](http://codeception.com/docs/05-UnitTests)
- [PHPUnit docs starting from chapter 2](http://phpunit.de/manual/current/en/writing-tests-for-phpunit.html)
## 运行基本和高级模板测试
运行基本和高级模板单元测试
----------------------------------------------
如果您已经开始使用高级模板,请参阅 ["testing" guide](https://github.com/yiisoft/yii2-app-advanced/blob/master/docs/guide/start-testing.md)
有关运行测试的更多细节。
请参阅 `apps/advanced/tests/README.md``apps/basic/tests/README.md` 提供的说明。
如果您已经开始使用基本模板,请参阅 [README "testing" section](https://github.com/yiisoft/yii2-app-basic/blob/master/README.md#testing)。
框架单元测试
--------------------
## 框架单元测试
如果你想运行 Yii 框架的单元测试
“[Getting started with Yii 2 development](https://github.com/yiisoft/yii2/blob/master/docs/internals/getting-started.md)”。

Loading…
Cancel
Save