From 6e52541a99f3ca78243f2a13c98622eb826c78a4 Mon Sep 17 00:00:00 2001 From: Albin Kerouaton Date: Mon, 16 Nov 2015 22:14:45 +0100 Subject: [PATCH] Add quote to yaml reserved chars in fixtures. --- README.md | 2 +- doc/customizing-data-generation.md | 2 +- doc/fixtures-refactoring.md | 2 +- doc/relations-handling.md | 18 +++++++++--------- .../Alice/support/fixtures/backslashes.yml | 2 +- .../Nelmio/Alice/support/fixtures/complete.yml | 8 ++++---- .../Nelmio/Alice/support/fixtures/include.yml | 4 ++-- tests/Nelmio/Alice/support/fixtures/part_1.yml | 4 ++-- tests/Nelmio/Alice/support/fixtures/part_2.yml | 6 +++--- .../Alice/support/fixtures/sequenced_items.yml | 6 +++--- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 96e482472..56028aa3f 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group1: name: Admins - owner: @user1 + owner: '@user1' members: x @user* created: updated: diff --git a/doc/customizing-data-generation.md b/doc/customizing-data-generation.md index bbcf15595..d5b459765 100644 --- a/doc/customizing-data-generation.md +++ b/doc/customizing-data-generation.md @@ -77,7 +77,7 @@ Nelmio\Data\Geopoint (local): Nelmio\Entity\Location: loc{1..100}: name: - geopoint: @geo1 + geopoint: '@geo1' ``` diff --git a/doc/fixtures-refactoring.md b/doc/fixtures-refactoring.md index 815ba6566..4a0cc3552 100644 --- a/doc/fixtures-refactoring.md +++ b/doc/fixtures-refactoring.md @@ -112,7 +112,7 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group1: name: Admins - owner: @user1 + owner: '@user1' members: x @user* created: updated: diff --git a/doc/relations-handling.md b/doc/relations-handling.md index 1cd58d808..e6fe2703c 100644 --- a/doc/relations-handling.md +++ b/doc/relations-handling.md @@ -15,7 +15,7 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group1: name: Admins - owner: @user1 + owner: '@user1' ``` Alice also allows you to directly reference objects' properties using the ```@name->property``` notation. @@ -27,7 +27,7 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group1: name: Admins - owner: @user1->username + owner: '@user1->username' ``` To be able to use this feature, your entities have to match some requirements : @@ -46,7 +46,7 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group1: name: Admins - owner: @user1->id + owner: '@user1->id' ``` If you want to create ten users and ten groups and have each user own one @@ -59,7 +59,7 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group{1..10}: - owner: @user + owner: '@user' ``` If you would like a random user instead of a fixed one, you can define a @@ -72,7 +72,7 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group1: name: Admins - owner: @user* + owner: '@user*' ``` It will then pick any object whose name matches `user*` where `*` can be any @@ -113,8 +113,8 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group1: name: Admins - owner: @user1 - members: [@user2, @user3] + owner: '@user1' + members: ['@user2', '@user3'] ``` Another, which is more interesting, is to define a reference with a wildcard, @@ -127,7 +127,7 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group1: name: Admins - owner: @user1 + owner: '@user1' members: 5x @user* ``` @@ -149,7 +149,7 @@ Nelmio\Entity\User: Nelmio\Entity\Group: group{1..10}: - members: @user{1..10} + members: '@user{1..10}' ``` > **Note**: You do not need to define multi-references inside an array, since diff --git a/tests/Nelmio/Alice/support/fixtures/backslashes.yml b/tests/Nelmio/Alice/support/fixtures/backslashes.yml index 6a64ce41e..4853796a7 100644 --- a/tests/Nelmio/Alice/support/fixtures/backslashes.yml +++ b/tests/Nelmio/Alice/support/fixtures/backslashes.yml @@ -4,4 +4,4 @@ Nelmio\Alice\support\models\User: user0: username: |- \\ - friends: [@foo, \@foo, \\@foo, \\\@foo] + friends: ['@foo', \@foo, \\@foo, \\\@foo] diff --git a/tests/Nelmio/Alice/support/fixtures/complete.yml b/tests/Nelmio/Alice/support/fixtures/complete.yml index 6db05251a..158db444b 100644 --- a/tests/Nelmio/Alice/support/fixtures/complete.yml +++ b/tests/Nelmio/Alice/support/fixtures/complete.yml @@ -8,22 +8,22 @@ Nelmio\Alice\support\models\User: user{1..10}: username: fullname: - birthDate: 80%? : 0000-00-00 + birthDate: '80%? : 0000-00-00' email: favoriteNumber: 40%? Nelmio\Alice\support\models\Contact: contact0: - __construct: [@user0] + __construct: ['@user0'] Nelmio\Alice\support\models\Group: group{0...1}: name: members: 20%? 3x @user* - owner: @user + owner: '@user' group1: name: members: 3x @user* owner: 1 - contactPerson: @contact*->user + contactPerson: '@contact*->user' contactPersonName: diff --git a/tests/Nelmio/Alice/support/fixtures/include.yml b/tests/Nelmio/Alice/support/fixtures/include.yml index fc1259fb3..905683952 100644 --- a/tests/Nelmio/Alice/support/fixtures/include.yml +++ b/tests/Nelmio/Alice/support/fixtures/include.yml @@ -8,11 +8,11 @@ parameters: Nelmio\Alice\fixtures\Product: product0: changed: y - user: @user1 + user: '@user1' product1: amount: 45 paid: n - user: @user0 + user: '@user0' Nelmio\Alice\fixtures\Shop: shop1: diff --git a/tests/Nelmio/Alice/support/fixtures/part_1.yml b/tests/Nelmio/Alice/support/fixtures/part_1.yml index 81130f1e5..f56f022f9 100644 --- a/tests/Nelmio/Alice/support/fixtures/part_1.yml +++ b/tests/Nelmio/Alice/support/fixtures/part_1.yml @@ -8,7 +8,7 @@ Nelmio\Alice\support\models\User: user{1..10}: username: fullname: - birthDate: 80%? : 0000-00-00 + birthDate: '80%? : 0000-00-00' email: favoriteNumber: 40%? @@ -17,7 +17,7 @@ Nelmio\Alice\support\models\User: favoriteNumber: 127 user_full (template, extends user_bare): fullname: - birthDate: 80%? : 0000-00-00 + birthDate: '80%? : 0000-00-00' email: favoriteNumber: 40%? user11 (extends user_full): diff --git a/tests/Nelmio/Alice/support/fixtures/part_2.yml b/tests/Nelmio/Alice/support/fixtures/part_2.yml index 743b169b9..50753e310 100644 --- a/tests/Nelmio/Alice/support/fixtures/part_2.yml +++ b/tests/Nelmio/Alice/support/fixtures/part_2.yml @@ -1,15 +1,15 @@ Nelmio\Alice\support\models\Contact: contact0: - __construct: [@user0] + __construct: ['@user0'] Nelmio\Alice\support\models\Group: group{0...1}: name: members: 20%? 3x @user* - owner: @user + owner: '@user' group1: name: members: 3x @user* owner: 1 - contactPerson: @contact*->user + contactPerson: '@contact*->user' contactPersonName: diff --git a/tests/Nelmio/Alice/support/fixtures/sequenced_items.yml b/tests/Nelmio/Alice/support/fixtures/sequenced_items.yml index 51507b3c2..860cfd75b 100644 --- a/tests/Nelmio/Alice/support/fixtures/sequenced_items.yml +++ b/tests/Nelmio/Alice/support/fixtures/sequenced_items.yml @@ -3,7 +3,7 @@ uuid: username: fullname: - birthDate: 80%? : 0000-00-00 + birthDate: '80%? : 0000-00-00' email: favoriteNumber: 40%? @@ -12,5 +12,5 @@ Nelmio\Alice\support\models\Group: group1: name: - members: @user{1..10} - owner: @user2 \ No newline at end of file + members: '@user{1..10}' + owner: '@user2'