作者knives ()
看板PHP
标题[请益] 请问有人也有在用codeception在做测试吗
时间Mon Dec 22 13:54:41 2014
最近打算要用Codeception 做测试
我在yaml 设定档有 用到Db 模组
Db 的设定档如下
Db:
dsn: 'mysql:host=192.168.1.1;dbname=testdb'
user: 'root'
password: 'pass word'
dump: 'tests/_data/dumper.sql'
populate: true
cleanup: true
现在的问题是,开始测试的时候,的确是会执行dumper.sql的语法
可是问题是,我要怎麽在测试结束的时候,执行清除资料
是要另外写test helper 去执行吗
谢谢回覆
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 125.227.47.246
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/PHP/M.1419227684.A.7FA.html
1F:→ meteorboy: 记得是 cleanup 设 true 就会自动清掉了,你已经有设啦 12/22 14:27
2F:→ knives: 可是我发现旧的资料还是存在,还是要另外写sql去删 12/22 18:19
3F:→ knives: 还是说清除的sql 也是写在dumper.sql里 12/22 18:20
4F:→ meteorboy: 你确定你的 dumper.sql 有执行吗? 12/25 22:32
5F:→ meteorboy: 你在跑 codeception 时 env 应该是 testing 会不会没 12/25 22:32
6F:→ meteorboy: 没有读到 db 的设定? 12/25 22:33