{"id":17959655,"url":"https://github.com/imjoehaines/flowder-phpunit","last_synced_at":"2025-11-11T19:33:14.483Z","repository":{"id":56990475,"uuid":"85879164","full_name":"imjoehaines/flowder-phpunit","owner":"imjoehaines","description":"A PHPUnit Listener for Flowder","archived":false,"fork":false,"pushed_at":"2018-09-27T09:16:19.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T20:53:55.571Z","etag":null,"topics":["fixture-loading","fixtures","flowder","phpunit","phpunit-listener","testing"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imjoehaines.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-03-22T21:45:21.000Z","updated_at":"2018-09-27T09:16:04.000Z","dependencies_parsed_at":"2022-08-21T13:50:19.405Z","dependency_job_id":null,"html_url":"https://github.com/imjoehaines/flowder-phpunit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjoehaines%2Fflowder-phpunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjoehaines%2Fflowder-phpunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjoehaines%2Fflowder-phpunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjoehaines%2Fflowder-phpunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjoehaines","download_url":"https://codeload.github.com/imjoehaines/flowder-phpunit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247052409,"owners_count":20875681,"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-loading","fixtures","flowder","phpunit","phpunit-listener","testing"],"created_at":"2024-10-29T11:04:00.514Z","updated_at":"2025-11-11T19:33:09.460Z","avatar_url":"https://github.com/imjoehaines.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flowder PHPUnit [![Latest Stable Version](https://poser.pugx.org/imjoehaines/flowder-phpunit/v/stable)](https://packagist.org/packages/imjoehaines/flowder-phpunit) [![Build Status](https://travis-ci.org/imjoehaines/flowder-phpunit.svg?branch=master)](https://travis-ci.org/imjoehaines/flowder-phpunit) [![codecov](https://codecov.io/gh/imjoehaines/flowder-phpunit/branch/master/graph/badge.svg)](https://codecov.io/gh/imjoehaines/flowder-phpunit)\n\n**Flowder PHPUnit** is a PHPUnit Test Listener for integrating the [Flowder](https://github.com/imjoehaines/flowder) fixture loader into PHPUnit test suites.\n\n## Usage\n\n1. Install Flowder PHPUnit as a development dependency through [Composer](https://getcomposer.org/)\n\n   ```sh\n   $ composer install imjoehaines/flowder-phpunit --dev\n   ```\n\n2. Enable Flowder PHPUnit as a test listener in your `phpunit.xml` file ([PHPUnit documentation](https://phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.test-listeners))\n\n   ```xml\n   \u003clisteners\u003e\n     \u003clistener class=\"\\Imjoehaines\\Flowder\\PhpUnit\\FlowderListener\"\u003e\u003c/listener\u003e\n   \u003c/listeners\u003e\n   ```\n\n3. Bootstrap Flowder PHPUnit by calling `FlowderListener::bootsrap` in your PHPUnit `bootstrap.php` file, passing in an instance of `\\Imjoehaines\\Flowder\\Flowder` (see the [Flowder documentation](https://github.com/imjoehaines/flowder) for more information).\n\n   This is only necessary until [PHPUnit #1873](https://github.com/sebastianbergmann/phpunit/issues/1873) is fixed. After this, you can configure Flowder PHPUnit through your `phpunit.xml` file instead.\n\n   A simple SQLite example might look like this:\n\n   ```php\n   \u003c?php\n\n   require __DIR__ . '/../vendor/autoload.php';\n\n   use Imjoehaines\\Flowder\\PhpUnit\\FlowderListener;\n\n   use Imjoehaines\\Flowder\\Loader\\PhpFileLoader;\n   use Imjoehaines\\Flowder\\Truncator\\SqliteTruncator;\n   use Imjoehaines\\Flowder\\Persister\\SqlitePersister;\n\n   $db = new PDO(...);\n   $db-\u003esetAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n   FlowderListener::bootstrap(\n       __DIR__ . '/_data/example.php',\n       new PhpFileLoader(),\n       new SqliteTruncator($db),\n       new SqlitePersister($db)\n   );\n   ```\n\n4. That's it! Before any test file runs, Flowder will load your fixture data for you\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjoehaines%2Fflowder-phpunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjoehaines%2Fflowder-phpunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjoehaines%2Fflowder-phpunit/lists"}