Symfony 1.4 中灯具文件的加载顺序是什么
在我当前的项目中,我有多个灯具文件。我想为每个文件分配与我的测试相关的数据。
即:
- 文章有一个作者
- 文章有多个标签
夹具:
test/fixtures/commonAuthor.yml
# Contains Common authors, with no particularities Author: Author1: name: Author1
test/fixtures/commonTag.yml
# Contains Common tags, with no particularities Tag: Tag1: name: Tag1 Tag2: name: Tag2
test/fixtures/test_Article.yml
# Contains All the data that is used by my functionals and unit tests Tag: Tag_not_active: name: Tag not active Article: Article_1: title: Article 1 Tags: [Tag1, Tag2] Author: Author1 Article_with_tag_innactive: title: Article 2 Tags: [Tag1, Tag2, Tag_not_active] Author: Author1
我想知道文件是按字母顺序还是按任何其他顺序加载。
谢谢。
In my current project, I have multiple fixtures files. I would like to assign each files with data related to my tests.
ie:
- Articles has one Author
- Articles has many tags
Fixtures:
test/fixtures/commonAuthor.yml
# Contains Common authors, with no particularities Author: Author1: name: Author1
test/fixtures/commonTag.yml
# Contains Common tags, with no particularities Tag: Tag1: name: Tag1 Tag2: name: Tag2
test/fixtures/test_Article.yml
# Contains All the data that is used by my functionals and unit tests Tag: Tag_not_active: name: Tag not active Article: Article_1: title: Article 1 Tags: [Tag1, Tag2] Author: Author1 Article_with_tag_innactive: title: Article 2 Tags: [Tag1, Tag2, Tag_not_active] Author: Author1
I wonder if the files are loaded alphabetically, or in any other order.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用原则,则会自动检测装置之间的依赖关系,并将加载它们以实现所有这些依赖关系。
如果您使用 propel,文件会按字母顺序加载。
If you're using doctrine, the dependencies between fixtures are detected automatically and they will be loaded in order to fulfill all of them.
If you're using propel, the files are loaded in alphabetical order.