{"id":25519683,"url":"https://github.com/aligent/oro-fixtures","last_synced_at":"2025-12-22T10:30:14.202Z","repository":{"id":37885063,"uuid":"496884889","full_name":"aligent/oro-fixtures","owner":"aligent","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-30T21:02:47.000Z","size":57,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-16T13:24:03.368Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aligent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2022-05-27T06:21:33.000Z","updated_at":"2022-06-15T03:06:27.000Z","dependencies_parsed_at":"2023-01-22T12:01:06.001Z","dependency_job_id":null,"html_url":"https://github.com/aligent/oro-fixtures","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2Foro-fixtures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2Foro-fixtures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2Foro-fixtures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2Foro-fixtures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aligent","download_url":"https://codeload.github.com/aligent/oro-fixtures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239703270,"owners_count":19683237,"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":[],"created_at":"2025-02-19T17:29:21.910Z","updated_at":"2025-12-22T10:30:14.121Z","avatar_url":"https://github.com/aligent.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Oro Fixtures Bundle\n===============================================\n\nDescription\n-----------\nThis bundle provides an abstract fixture class that can be extended to load Alice fixtures. Providing an easy way to load small subsets of demo/test data for developer environments. These fixtures can then be easily shared with any Behat tests created for your bundles. \n\nThis bundle is not intended to be loaded in production and will only load it's required services in dev mode. \n\nInstallation Instructions\n-------------------------\n1. Install this module via Composer\n\n        composer require --dev aligent/oro-fixtures\n\n1. Add the below to your `src/AppKernel.php` `registerBundles` function\n\n    ```php\n    if (class_exists('Nelmio\\Alice\\Bridge\\Symfony\\NelmioAliceBundle')\n        \u0026\u0026 class_exists('Fidry\\AliceDataFixtures\\Bridge\\Symfony\\FidryAliceDataFixturesBundle')) {\n        $bundles[] = new Nelmio\\Alice\\Bridge\\Symfony\\NelmioAliceBundle();\n        $bundles[] = new Fidry\\AliceDataFixtures\\Bridge\\Symfony\\FidryAliceDataFixturesBundle();\n    }\n    ```\n\n1. Clear cache\n        \n        php bin/console cache:clear --env=dev\n        \nInitializers\n------------\nIntializers provide a way for Alice fixtures to reference entities that already exist in the database.\n\nThis bundle comes with the below initializers:\n\n|Initializer| Description                                                                                                                                               | Example                                                               |\n|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|\n|AdminUserInitializer| First user with `ROLE_ADMINISTRATOR`                                                                                                                      | `@admin_user`                                                         |\n|CustomerUserRoleInitializer| All customer user roles                                                                                                                                   | `@buyer`, `@admin`                                                    |\n|ProductUnitInitializer| All product unit codes prefixed with `unit`                                                                                                               | `@unit_each`                                                          |\n|RootCategoryInitializer| The master catalogs root category                                                                                                                         | `@root_category`                                                      |\n|WarehouseInitializer| The snake case version of the name of each warehouse (Enterprise only) prefixed with `warehouse`                                                          | `Some Warehouse` becomes `@warehouse_some_warehouse`                  |\n|BusinessUnitInitializer| All of the existing business units suffixed with `_business_unit`                                                                                         | `North Office` becomes `@north_office_business_unit`                  |\n|DefaultPriceListInitializer| The default price list                                                                                                                                    | `@default_price_list`                                                 |\n|OrganizationInitializer| If more than one organization exists the normalized name of of the organization prefixed by `org_`. If only one exists it is named `default_organization` | `@default_organization` or `Our Business` becomes `@org_our_business` |\n|SegmentTypeInitializer| The available segment types                                                                                                                               | `@dynamic_segment_type` or `static_segment_type`                      |\n|WebsiteInitializer| All website names prefixed by `website_`                                                                                                                  | `Some Store` becomes `@website_some_store`                            |\n|CustomerGroupInitializer| All customer group names prefixed with `group_`                                                                                                           | `Registered Buyers` becomes `@group_registered_buyers`                |\n|InventoryStatusInitializer| All inventory status ids prefixed by `inventory_status_`                                                                                                  | `@inventory_status_in_stock` or `@inventory_status_out_of_stock`      |\n|ProductFamilyInitializer| All Attribute family names prefixed with `product_family_`                                                                                                | `Clothing Attributes` becomes `@product_family_clothing_attributes`   |\n|CustomerTaxCodeInitializer| The customer tax code lowercased and prefixed with `customer_tax_code_`                                                                                   | `GST_FREE` becomes `@customer_tax_code_gst_free`                      |\n\nAdding and Running Fixtures\n-----------\n1. Ensure your database has been initialized with an empty installation of OroCommerce (i.e. DO NOT ADD DEMO DATA)\n\n1. Snapshot your database to create a rollback point \n1. In your bundle create the Demo fixture directory e.g. `src/Acme/BaseBundle/Migrations/Data/Demo/ORM`\n\n1. Create a subdirectory called `data` e.g. `src/Acme/BaseBundle/Migrations/Data/Demo/ORM/data` and add an alice fixture e.g.\n    ```yaml\n    Oro\\Bundle\\ProductBundle\\Entity\\ProductName:\n        product_A_1_name:\n            string: 'Product A 1'\n\n    Oro\\Bundle\\ProductBundle\\Entity\\ProductUnitPrecision:\n        unit_precisionA1:\n            unit: '@unit_each'\n            precision: '1'\n\n    Oro\\Bundle\\ProductBundle\\Entity\\Product:\n        product_A_1:\n            type: 'simple'\n            sku: 'PROD_A_1'\n            organization: '@organization'\n            attributeFamily: '@defaultProductFamily'\n            primaryUnitPrecision: '@unit_precisionA1'\n            __calls:\n                - addName: ['@product_A_1_name']\n            status: 'enabled'\n            inventoryStatus: '@enumInventoryStatuses'\n\n    Oro\\Bundle\\PricingBundle\\Entity\\ProductPrice:\n        price_A_1:\n            product: '@product_A_1'\n            priceList: '@defaultPriceList'\n            currency: 'AUD'\n            quantity: 1\n            unit: '@unit_each'\n            value: 12\n\n    Oro\\Bundle\\PricingBundle\\Entity\\PriceListToProduct:\n        priceRelation_A_1:\n            product: '@product_A_1'\n            priceList: '@defaultPriceList'\n    ```\n1. In the demo fixtures directory create a new fixture that extends the `AbstractAliceFixture` and implement the `getFixtures`. This can point to a single file or a directory of yml files.\n    ```php\n    \u003c?php\n\n    namespace Acme\\BaseBundle\\Migrations\\Data\\Demo\\ORM;\n\n    use Aligent\\FixturesBundle\\Fixtures\\AbstractAliceFixture;\n\n    class ExampleDemoDataFixture extends AbstractAliceFixture\n    {\n        protected function getFixtures(): string\n        {\n            return __DIR__ . '/data';\n        }\n    }\n\n    ```\n1. To execute the fixtures run:\n    ```bash\n        bin/console oro:migration:data:load --env=dev --fixtures-type=demo --bundles=AcmeBaseBundle --bundles=AcmeAnotherBundle\n    ```\n\n\nSupport\n-------\nIf you have any issues with this bundle, please feel free to open [GitHub issue](https://github.com/aligent/oro-fixtures/issues) with version and steps to reproduce.\n\nContribution\n------------\nAny contribution is highly appreciated. The best way to contribute code is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests).\n\nDeveloper\n---------\nAdam Hall \u003cadam.hall@aligent.com.au\u003e.\n\nLicense\n-------\n[GPLv3](https://opensource.org/licenses/GPL-3.0)\n\nCopyright\n---------\n(C) 2022 Aligent Consulting\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faligent%2Foro-fixtures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faligent%2Foro-fixtures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faligent%2Foro-fixtures/lists"}