{"id":24291481,"url":"https://github.com/adlarge/fixtures-documentation-bundle","last_synced_at":"2025-09-25T17:30:18.974Z","repository":{"id":56940930,"uuid":"196219481","full_name":"adlarge/fixtures-documentation-bundle","owner":"adlarge","description":"Symfony bundle to generate and expose a documentation of your fixtures.","archived":false,"fork":false,"pushed_at":"2021-01-06T10:49:11.000Z","size":517,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-15T22:51:29.700Z","etag":null,"topics":["fixture","fixtures","php7","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adlarge.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-10T14:22:37.000Z","updated_at":"2022-11-29T22:02:16.000Z","dependencies_parsed_at":"2022-08-21T07:20:46.517Z","dependency_job_id":null,"html_url":"https://github.com/adlarge/fixtures-documentation-bundle","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adlarge%2Ffixtures-documentation-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adlarge%2Ffixtures-documentation-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adlarge%2Ffixtures-documentation-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adlarge%2Ffixtures-documentation-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adlarge","download_url":"https://codeload.github.com/adlarge/fixtures-documentation-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234215849,"owners_count":18797510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fixture","fixtures","php7","symfony","symfony-bundle"],"created_at":"2025-01-16T14:33:21.569Z","updated_at":"2025-09-25T17:30:18.168Z","avatar_url":"https://github.com/adlarge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Fixtures Documentation Bundle\n=========\n\n[![Package version](https://img.shields.io/packagist/v/adlarge/fixtures-documentation-bundle.svg?style=flat-square)](https://packagist.org/packages/adlarge/fixtures-documentation-bundle)\n[![Build Status](https://travis-ci.org/adlarge/fixtures-documentation-bundle.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/adlarge/fixtures-documentation-bundle?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/adlarge/fixtures-documentation-bundle/badge.svg?branch=master)](https://coveralls.io/github/adlarge/fixtures-documentation-bundle?branch=master)\n[![License](https://img.shields.io/badge/license-MIT-red.svg?style=flat-square)](LICENSE)\n\nThis Symfony bundle generates and exposes a documentation of your fixtures.\nAn action to reload your fixtures can also be configured.\n\nThe goal of this bundle is to allow testers to be independent, they can see data and reload fixtures when they want to test again.\n    \n## What does it do\n\nIt will generate a json file with all the data to be used in a twig page to display fixtures to the end user.\n\nTo add data to this json file you can process full manually, manually by passing the entity or full automatically.\nThe main data to know of are : the type of the fixture (section title), the id of the fixture and the data of the fixture.\n\nIt will display a page with a menu corresponding to the different sections (with links), and data tables regrouped by section.\nIf you used links, it will display some columns with visible links to go directly to the linked object.\n\nWhen it encounter a property it can have 3 behaviors :\n\n* If it's a simple (scalar) property, it will display it (string, bool, int, etc)\n* If it's an array, it will display the total of elements in this array\n* If it's an object and it got a __toString public method, it will display the result of this method. \n  If this class is in your configuration of entities, it will add a link toward it.\n\n## Working projects examples\n\nSome external projects are available to see and test the behavior of this bundle. You'll have to clone it next to this bundle \nand follow the documentation to make it work and see the prepared result by yourself.\n\n* The project for [Manual case](https://github.com/bluepioupiou/fixture-doc-manualcase) : if you want to manually manage your documentation\n* The project for [Doctrine automatic case](https://github.com/bluepioupiou/fixture-doc-autocase) : if you use doctrine and just want to configure entities and properties to document and let the bundle do\n* The project for [Alice case](https://github.com/bluepioupiou/fixture-doc-alicecase) : if you load fixtures through Alice bundle and want to let the bundle do with your configuration\n\n## Installation\n\nThis is installable via [Composer](https://getcomposer.org/) as\n[adlarge/fixtures-documentation-bundle](https://packagist.org/packages/adlarge/fixtures-documentation-bundle):\n\n    composer require --dev adlarge/fixtures-documentation-bundle\n\nThe default url to access the documentation is **/fixtures/doc**\n\n## Configuration\n\nAdd the bundle to your `config/bundles.php` :\n\n    return [\n        // ...\n        Adlarge\\FixturesDocumentationBundle\\AdlargeFixturesDocumentationBundle::class =\u003e ['dev' =\u003e true],\n        // ...\n    ];\n\nAdd the routing file `config/routes/dev/adlarge_fixtures_documentation.yaml` and paste the following content :\n\n    AdlargeFixturesDocumentation:\n        resource: '@AdlargeFixturesDocumentationBundle/Resources/config/routing.yml'\n\nYou can define vars by creating the file `config/packages/dev/adlarge_fixtures_documentation.yaml` :\n\n    adlarge_fixtures_documentation:\n        title: 'Your title'\n        reloadCommands:\n            - php bin/console doctrine:fixtures:load\n            - ....\n        listenedCommand: 'doctrine:fixtures:load'\n        enableAutoDocumentation: true\n        fileDest: '%kernel.project_dir%/custom-folder'\n        configEntities:\n            Product:\n                - id\n                - name\n                - category\n            Customer:\n                - firstname\n                - lastname\n\n* **title -** has a default value 'Fixtures documentation'\n* **listenedCommand -** has a default value 'doctrine:fixtures:load'. For Alice bundle, you can set it to 'hautelook:fixtures:load'\n* **reloadCommand -** is an optional array of commands you want to run from the view. If present a button to run these command will be visible in this view\n* **enableAutoDocumentation -** is a boolean default to false. Set it to true if you want that all entities in fixtures are auto documented in postPersist\n* **fileDest -** override default documentation file location in var folder\n* **configEntities -** is an optional array of configurations for your entities you want to auto-document\n\nThen you can install assets :\n\n    php bin/console assets:install --symlink\n\n## Examples\n\nYou can use 'enableAutoDocumentation' configuration. If set to 'True' this configuration will automatically\ndocument all objects according to 'configEntities' configuration when they are postPersist in database.\n\nThe postPersist is checked only where you configure the bundle (hopefully dev and test/acceptance) and when you launch the listenedCommand.\n\nThe examples are based on the following entities and properties\n\n* 1 Customer, John Doe with\n    * id\n    * firstname\n    * lastname\n    * email\n* 2 Products, linked to John Doe with\n    * id\n    * name\n    * tags\n    * owner \n    \nAll of their properties have public getter to access them\n\n### With doctrine\n\nWith this example configuration \n\n```yaml\n    adlarge_fixtures_documentation:\n      title: Documentation auto\n      enableAutoDocumentation: true\n```\n\nYou just have to persist entities in the code when your listenedCommand is resolved\n\n```php\n    $john = (new Customer())\n        -\u003esetFirstname('John')\n        -\u003esetLastname('Doe')\n        -\u003esetEmail('john.doe@test.fr');\n\n    $manager-\u003epersist($john);\n\n    $product = (new Product())\n        -\u003esetName(\"Product 1\")\n        -\u003esetCategory(\"Category 1\")\n        -\u003esetOwner($john)\n        -\u003esetTags(['tag1', 'tag2']);\n\n    $manager-\u003epersist($product);\n\n    $product = (new Product())\n        -\u003esetName(\"Product 2\")\n        -\u003esetCategory(\"Category 2\")\n        -\u003esetOwner($john)\n        -\u003esetTags(['tag2', 'tag2', 'tag3']);\n\n    $manager-\u003eflush();\n```\n\n### With Alice bundle\n\nWith this example configuration \n\n```yaml\n    adlarge_fixtures_documentation:\n      title: Documentation alice\n      enableAutoDocumentation: true\n      listenedCommand: hautelook:fixtures:load\n      reloadCommands:\n        - php bin/console hautelook:fixtures:load\n```\n\nYou can then use the yaml configuration to load entities\n\n```yaml\n    App\\Entity\\Customer:\n      john:\n        firstname: John\n        lastname: Doe\n        email: john.doe@test.com\n    \n    App\\Entity\\Product:\n      product1:\n        name: product 1\n        owner: '@john'\n      product2:\n        name: product 2\n        owner: '@john'\n```\n\n### Result\n\nBoth ways will follow this rule to auto document your entities :\n\nIt will take all public methods starting with 'get' and use them to document each entity.\n\n![Auto configuration](/doc/img/fixtures-documentation-empty.png)\n\n### More configurations\n\nMore configuration options are available [in this doc](doc/MORE_CONFIG.md)\n\n## Generate documentation\n\nTo generate the doc you only have to run `php bin/console doctrine:fixtures:load` or the command you've configured on your project.\n\n## Development\n\nTo make it run on your environment you have to install :\n\n    composer\n    php (7.1 or higher)\n    PHP extensions\n    * php-xml\n    * php-mbstring\n    * php-xdebug\n\nTo run tests on your env, run these commands. Each dev must cover 100% of code before PR\n\n    make test\n    make coverage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadlarge%2Ffixtures-documentation-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadlarge%2Ffixtures-documentation-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadlarge%2Ffixtures-documentation-bundle/lists"}