简体   繁体   English

使用doctrine2测试symfony2的数据生成器

[英]Test data generator for symfony2 with doctrine2

I'm facing a common problem with generating data sets for testing purpose in my application. 我面临着在我的应用程序中生成用于测试目的的数据集的常见问题。 I've found many tools which provides raw data generation ( http://www.webresourcesdepot.com/test-sample-data-generators/ ) but I'm looking for something more sophisticated. 我发现了许多提供原始数据生成的工具( http://www.webresourcesdepot.com/test-sample-data-generators/ ),但我正在寻找更复杂的东西。

I have a symfony2 with doctrine2 project. 我有一个带有doctrine2项目的symfony2。 Entities are defined with proper relations - one to one, one to many, many to many. 实体的定义具有适当的关系 - 一对一,一对多,多对多。 Is there any solution which will provide automatic data generation based on those entities? 是否有任何解决方案可以基于这些实体提供自动数据生成? Maybe it's too much, maybe not. 也许它太多了,也许不是。 Thanks for any hints. 谢谢你的任何提示。

You should look into: 你应该看看:

  • Doctrine data fixtures - loads fixtures and allows you to clear tables at each test run Doctrine数据夹具 - 加载夹具并允许您在每次测试运行时清除表
  • Alice - allows you to load fixtures from csv/yaml/xml/etc Alice - 允许您从csv / yaml / xml / etc加载灯具
  • Faker - allows you to generate random data by seed - integrates with data-fixtures Faker - 允许您通过种子生成随机数据 - 与数据夹具集成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM