Skip to content

Commit

Permalink
more tests; docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Oct 21, 2022
1 parent 7d5dc3f commit b5d32b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Resources/doc/DSL/Faker.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ you can use this instead:
It works as the original `randomHtml` property, except that it generates rich text compatible with the XmlText
field type.

* the `randomXmlText($maxDepth=4, $maxWidth=4)` property.
Same as the above, for the RichText field type.

* the `adjective`, `animal` and `noun` properties, which generate each a single word of the specific type.
Words are only in english, and they come from lists deployed as .txt file within the bundle

* the `pdfFile($dir = '/tmp', $pages=5, $title = '', $author = '', $subject = '', $keywords = '')` property.
It can be used to generate PDF files with random contents, and will return the name of the generated file

Expand Down
4 changes: 2 additions & 2 deletions Tests/dsl/good/LipsumTestOK001.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
content_type: klib_test_001
parent_location: 2
attributes:
name: " Test item [loop:iteration] - [faker:sentence(3)]"
name: 'Test item [loop:iteration] - [faker:sentence(3)] - [faker: randomelement({0:"hello", 1:"world"})]'
references:
-
attribute: location_id
Expand All @@ -94,7 +94,7 @@
content_type: klib_test_001
parent_location: reference:parent_folder_loc
attributes:
name: "Test item [faker:uuid] : [faker:adjective] [faker:noun] [faker:animal]"
name: "Test item [faker:uuid] - [faker:adjective] [faker:noun] [faker:animal]"
# @todo it seems that some country codes from Faker are not known to eZ and/or we have an array-vs-string issue...
#country: "faker:countryCode"
email: "faker:email"
Expand Down
4 changes: 2 additions & 2 deletions WHATSNEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Version 1.4

* New: the bundle now includes a custom Faker generator that registers the modifier `maxDistinct($maxElements = 100, $reset = false)`
This can be used when you want to limit a generated element to be limited to have a limited set of distinct values.
If can be f.e. useful when you generate images or files by querying remote services which impose limits on the
It can be f.e. useful when you generate images or files by querying remote services which impose limits on the
number of calls that can be placed.
Eg: by using `maxDistinct().picture`, your code would only be retrieving 100 different pictures.
Please note that this modifier does not insure uniqueness of the results, but it can be combined with `unique()`.
Expand All @@ -43,7 +43,7 @@ Version 1.3
* New: the bundle now includes a custom Faker provider that registers the properties `noun`, `adjective` and `animal`.
Those are not yet multilingual and will return only english words.

* New: the bundle now includes a custom Faker provider that registers the `pdfText` property. It can be used to generate
* New: the bundle now includes a custom Faker provider that registers the `pdfFile` property. It can be used to generate
pdf files which contain random rich text.

* Minor tweaks to the xmlText generator
Expand Down

0 comments on commit b5d32b6

Please sign in to comment.