You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,6 +14,8 @@ And it currently supports the following databases:
14
14
15
15
* MySQL
16
16
17
+
The fixture manager also allows you to replace placeholders in your fixtures programatically. See examples below.
18
+
17
19
## Usage
18
20
19
21
Suppose that you have two fixtures for your country and employee tables called country.xml and employee.yml, respectively. You load them into a MySQL database with a few lines of code:
@@ -50,14 +52,48 @@ $fixtureManager
50
52
->persist();
51
53
```
52
54
55
+
In the values for your fixtures files, you can put placeholders for the values. This allows you to change the values dynamically, such as, place the current date.
56
+
57
+
To do this, when creating the Fixture Manager pass an array with the keys in the form "fx:placeholder:<my_name>". For example:
58
+
59
+
```php
60
+
use TheIconic\Fixtures\FixtureManager\FixtureManager;
61
+
62
+
// Declare an array with the path to your fixtures
63
+
$fixtures = ['./fixtures/employee.yml'];
64
+
65
+
// Create a new Fixture Manager passing such array
0 commit comments