测试PDF文件的代码接收

问题描述 投票:3回答:1

Im使用YII2,Im开始使用CODECEPTION建立测试。我尝试在线寻找该问题的答案,但找不到任何答案。

测试生成的PDF文件内容的最佳方法是什么。我的想法是,我们已经生成了通过邮件发送的报告。这些邮件将附有我要测试的PDF文件。我想使用诸如>>之类的函数

$I->see($text)

但是对于生成的PDF文件。

如何完成?

Im使用YII2,Im开始使用CODECEPTION建立测试。我尝试在线查找该问题的答案,但找不到任何答案。测试生成的PDF文件的最佳方法是...

php testing yii2 codeception
1个回答
0
投票
initially you must install Filesystem you can see how here [FILESYSTEM][1]after that Make sure the browser saves the download to expected destination.
Convert PDF to text file with a command line utility ($I->runShellCommand)
(you have to install [CLI][2])
make assertions on this pdf extract ($I->seeInThisFile)


  [1]: https://codeception.com/docs/modules/Filesystem#Installation
  [2]: https://codeception.com/docs/modules/Cli#Installation
© www.soinside.com 2019 - 2024. All rights reserved.