修改过程
mouyong
4年前
修改理由:
相关信息:
- 类型:教程文章
- 文章: 编写单元测试
- 课程: 《LX2 PHP 扩展包实战教程 - 从入门到发布()》
此投稿状态为 标记为已读。
内容修改:
Old | New | Differences |
---|---|---|
28 | 28 | |
29 | 29 | ![file](https://lccdn.phphub.org/uploads/images/201808/15/76/1Gn6RMmSDh.png?imageView2/2/w/1240/h/0) |
30 | 30 | |
31 | 得到的测试类如下: | |
31 | 得到类似如下的测试类: | |
32 | ||
33 | ![file](https://lccdn.phphub.org/uploads/images/201808/24/6324/VKK5pyYVfM.png?imageView2/2/w/1240/h/0) | |
34 | ||
35 | 我们新建的测试类继承自 psr-0 规范的 TestCase。 | |
36 | ||
37 | 为了避免如下报错: | |
38 | ||
39 | ![file](https://lccdn.phphub.org/uploads/images/201808/24/6324/NemrqU2xfQ.png?imageView2/2/w/1240/h/0) | |
40 | ||
41 | 接下来我们需要做点小调整,引入 psr-4 规范的 TestCase ,修改继承。 | |
42 | 最终得到的测试类如下: | |
32 | 43 | |
33 | 44 | *tests/WeatherTest.php* |
34 | 45 |