I'm quite new to codeception and I'm not sure how to accomplish this. Searching the documentation I did find the command $I->openFile('composer.json'); that belongs to the Filesystem module, but from what I could understand it doesn't provide me means to extract the data from the file. What I would really like to do is provide a file to my test that will have some unique keys to be used as variables during test execution, so after openFile I would need some means to put file data in a variable and work with it. Is this possible in codeception? (or in pure PHP or cucumber, that I'm also using in tests) Thanks in advance!
Asked
Active
Viewed 336 times
2
-
You should be able to find plenty of examples for pure PHP, both on and off the site. Will your file be in JSON format? – El_Vanja May 10 '21 at 13:47
-
probably just a plain txt file – João Paulo Leandro Teodoro Luz May 10 '21 at 14:02
-
Then you might start [here](https://stackoverflow.com/questions/4103287/read-a-plain-text-file-with-php) and see if it solves your problem. – El_Vanja May 10 '21 at 14:03
-
I think it does, guess I didn't think much outside of the codeception box here. Thanks for the help! – João Paulo Leandro Teodoro Luz May 10 '21 at 14:09