CakePHP Test Fixtures Drop My Tables Permanently After Running A Test Case

后端 未结 3 2114
说谎
说谎 2021-01-27 03:28

I\'m not sure what I\'ve done wrong in my CakePHP unit test configuration. Every time I run a test case, the model tables associated with my fixtures are missing form my test da

3条回答
  •  遇见更好的自我
    2021-01-27 04:00

    I think that's the idea. Fixtures are fixed tables with fixed contents. They're not the tables you use otherwise in production or during development. That's why they have a separate connection in database.php, you're supposed to use a different database or at least a different prefix for test tables. These will be created based on your fixtures before each test and torn down afterwards, so you're always testing against a known set of data.

提交回复
热议问题