-
Notifications
You must be signed in to change notification settings - Fork 2
Tables
Every single fixture file represents only one SQL table and it's data. All the further SQL instructions(like INSERT
, DELETE
and others) will be generated using this table name.
There is a convention that the fixture file name converts to SQL table name almost "as is":
-
users.yaml
fixture generates instructions forusers
table -
ticket_comments.yaml
fixture generates instructions forticket_comments
table -
Man_In_Black.yaml
fixture generates instructions forMan_In_Black
table
But the only exception does exist: dots in fixture file name are prohibited, except the dot in .yaml
(or .yml
) file extension. If you'd like to define a table with dots, like, public.comments
or search.articles
, please, use sub folders with unlimited depth:
users.yaml # users
+ public/
comments.yaml # public.comments
tickets.yaml # public.tickets
+ search/
articles.yaml # search.articles
references.yaml # search.references
+ old/
usage.yaml # search.old.usage
failures.yaml # search.old.failures
Sub folders with fixtures either can not have dots to avoid collisions like below:
+ old/
+ searches/
log.yaml # old.searches.log
+ old.searches/
log.yaml # also old.searches.log?
Note, that YAML files have two valid extensions: .yaml
and .yml
. Both extensions are equally supported by JFixtures. However, there is an edge case: the same fixture could not be located twice with different extensions:
users.yaml # users
+ public/
comments.yaml # public.comments
comments.yml # public.comments
JFixtures will throw an exception because public.comments
table was defined twice in this example(by public/comments.yaml
and public/comments.yml
)
Table of contents