开发者

Rearranging order of @dataProvider and database setup

So, Zend's phpunit开发者_JS百科 database framework allows preloading a database with tables. However, this stops me from using @dataProvider with the database because it appears that @dataProvider gets executed before zend reloads the database. This causes the database tables to be out of sync.

Is there a way I can rearrange this procedure so that zend reloads the database, then @dataProvider gets called?


When does Zend load your database? If you call it specifically from setUp() you could move the call to the data provider method. It's not ideal, but the way that PHPUnit calls the data providers is pretty core to its architecture. Sebastian is planning to rework this as some point, but I don't know how high it is on the priority list.

Edit: Sebastian created a ticket that discusses reordering tests based on @depends--not changing when data providers are called. My apologies for the confusion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜