1

Is it possible in phpunit to use a yaml file that contains configuration setting to be used in tests?

If so how as I cant see this in the documentation.

I am thinking that it might be possible to use such a file to contain useful data used throughout tests.

4

1 回答 1

0

You can use yaml to initialize a database, or as the expected result for a database-related assert: http://www.phpunit.de/manual/3.7/en/database.html#understanding-datasets-and-datatables

I don't believe there is any built in support for a yaml data provider, but if you have a parser that converts yaml to a flat array, you could easily write your own. http://www.phpunit.de/manual/3.7/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers

于 2012-12-10T00:13:21.730 回答