liip / liip/LiipTestFixturesBundle

Load fixture without a file path

Open
#245 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
178
Forks
48
PR merge metrics
No merged PRs in 30d

Description

> from my understanding, we always have to define our fixture in a separate class,
> what i would really like is to define the fixture data inside my test function, (maybe not always but at least sometimes)
>
> i really like the idea of having a tight coupling between a test and the specific data it requires, to avoid creating some kind of global state that will be likely to break at scale.
>
> Is there any way to achieve that with your lib ? something like
>
> ```
> $this->databaseTool->loadFixturesInline(function(){ //define fixture code here... });
> ```

_Originally posted by @vulkanosaure in https://github.com/liip/LiipTestFixturesBundle/issues/64#issuecomment-1805054667_

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The request concerns the fixture-loading entry point illustrated as `$this->databaseTool->loadFixturesInline(...)`; no file or test path is named, so start by tracing the bundle's existing fixture-loading API. Done means a test can define fixture data inside the test function without a separate fixture class, with the inline behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, symfony
Domain
database, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.