Skip to content

[Bug]: The append functionality works wrong in the 2.x branch #331

Open
@slutsky

Description

@slutsky

Preconditions

The append functionality works wrong in the 2.x branch. When I try to add an additional fixture using $this->databaseTool->loadFixtures($fixtures, true) I loose all previous references.

Steps to reproduce

In ConfigMysqlTest::testAppendFixtures() I added an additional check:

public function testAppendFixtures(): void
{
    $this->databaseTool->loadFixtures([
        'Liip\Acme\Tests\App\DataFixtures\ORM\LoadUserData',
    ]);

    $referenceRepository = $this->databaseTool->loadFixtures(
        ['Liip\Acme\Tests\App\DataFixtures\ORM\LoadSecondUserData'],
        true
    )->getReferenceRepository();

    // Expected 2, but 1 returned.
    $this->assertCount(2, $referenceRepository->getReferences());

Expected result

All tests with additional check pass.

Actual result

Tests are broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions