当前位置: 首页 > 工具软件 > yii2-wschat > 使用案例 >

yii2 代码测试

夏侯智鑫
2023-12-01

创建测试文件

./vendor/bin/codecept g:test unit Topic #创建一个名为TopicTest的单元测试类

./vendor/bin/codecept g:cest functional TopicCest #创建名为TopicCest的功能测试类

运行测试

vendor/bin/codecept run #运行所有测试
vendor/bin/codecept run unit tests/unit/models/TopicTest  -v #运行models/TopicTest单元测试类

功能测试同上

测试数据库配置在 config/test_db.php

 类似资料: