https://github.com/imjoehaines/flowder-yaml-loader
A YAML file loader for Flowder
https://github.com/imjoehaines/flowder-yaml-loader
fixture-loading fixtures flowder testing yaml
Last synced: 18 days ago
JSON representation
A YAML file loader for Flowder
- Host: GitHub
- URL: https://github.com/imjoehaines/flowder-yaml-loader
- Owner: imjoehaines
- License: unlicense
- Created: 2017-04-07T20:00:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-14T11:44:50.000Z (over 8 years ago)
- Last Synced: 2025-07-14T12:56:54.421Z (11 months ago)
- Topics: fixture-loading, fixtures, flowder, testing, yaml
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flowder YAML Loader [](https://packagist.org/packages/imjoehaines/flowder-yaml-loader) [](https://travis-ci.org/imjoehaines/flowder-yaml-loader) [](https://codecov.io/gh/imjoehaines/flowder-yaml-loader)
A YAML file loader for [Flowder](https://github.com/imjoehaines/flowder)
## Usage
1. Install Flowder YAML Loader as a development dependency through [Composer](https://getcomposer.org/)
```sh
$ composer install imjoehaines/flowder-yaml-loader --dev
```
2. Pass an instance of `Imjoehaines\FlowderYaml\YamlLoader` to Flowder, as detailed in the [Flowder readme](https://github.com/imjoehaines/flowder/blob/master/README.md#usage)
3. Pass the path to a YAML file to `Flowder::loadFixtures`, your YAML file should contain an array of arrays where each "inner" array is a database row. For example
```yaml
row_1:
column_1: value 1
column_2: 2
column_3: three
row_2:
column_1: value 4
column_2: 5
column_3: six
```
Any YAML array syntax supported by [Symfony's Yaml Component](http://symfony.com/doc/current/components/yaml.html) is supported, so all of the following examples will result in the exact same data as above
```yaml
-
column_1: value 1
column_2: 2
column_3: three
-
column_1: value 4
column_2: 5
column_3: six
```
```yaml
[
{
"column_1": "value 1",
"column_2": 2,
"column_3": "three"
},
{
"column_1": "value 4",
"column_2": 5,
"column_3": "six"
}
]
```