Skip to content
This repository was archived by the owner on Aug 28, 2018. It is now read-only.

Conversation

viliam-husar
Copy link

Proposed changes allows to load files in fixtures. It is compatible with the symfony cookbook article about uploading files in doctrine and also with VichUploaderBundle. If you consider these changes as acceptable I will update docs. I also changed the composer.json, because it was impossible to make it work work with symfony 2.2.0BETA.

Example:

model:                          App\Bundle\SomeBundle\Entity\SomeDocument
tags:                           [ test, dev ]
save_in_reverse:                false
file_fields:                    [ file ]
persistence:                    orm
fixtures:
   some_document_1:
        name: 'xxx'
        file: some_document/1.txt

The path is relative to fixtures yml file.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's "$file" here, but it was "$path" in the constructor

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is because $fixtures_data in constructor is $file. (Correction would require small refactoring.)

@khepin
Copy link
Owner

khepin commented Jan 22, 2013

What was blocking with 2.2?

@viliam-husar
Copy link
Author

Composer output:

Problem 1
    - Installation request for khepin/yaml-fixtures-bundle dev-patch-files -> satisfiable by khepin/yaml-fixtures-bundle dev-patch-files.
    - Conclusion: remove symfony/symfony 2.2.x-dev
    - Installation request for doctrine/doctrine-fixtures-bundle dev-master -> satisfiable by doctrine/doctrine-fixtures-bundle dev-master.
    - Conclusion: don't install symfony/symfony 2.2.x-dev
    - doctrine/doctrine-bundle 1.2.x-dev requires symfony/framework-bundle >=2.2.0-beta2,<2.3-dev -> satisfiable by symfony/symfony 2.2.x-dev, symfony/symfony 2.2.x-dev, symfony/framework-bundle 2.2.x-dev.
    - doctrine/doctrine-bundle 1.2.x-dev requires symfony/framework-bundle >=2.2.0-beta2,<2.3-dev -> satisfiable by symfony/symfony 2.2.x-dev, symfony/symfony 2.2.x-dev, symfony/framework-bundle 2.2.x-dev.
    - don't install symfony/framework-bundle 2.2.x-dev|don't install symfony/symfony v2.2.0-BETA1
    - Installation request for symfony/symfony 2.2.* -> satisfiable by symfony/symfony 2.2.x-dev, symfony/symfony v2.2.0-BETA1.
    - Installation request for doctrine/doctrine-bundle 1.2.* -> satisfiable by doctrine/doctrine-bundle 1.2.x-dev.

This wasn't wery helpful, but finally the problem part is:

"doctrine/doctrine-fixtures-bundle": "2.*@alpha",

beacuse of it's composer.json. When I changed (in your original composer.json) only this dependency for

"doctrine/doctrine-fixtures-bundle": "dev-master",

problem disappeared. So if you want I can change composer.json again.

@viliam-husar
Copy link
Author

And I think that dependency for

"doctrine/data-fixtures": "1.*@alpha",

is not required.

@khepin
Copy link
Owner

khepin commented Jan 22, 2013

That's kind of me being a freak about tagging all versions and never using dev-master... I'll have a look

@viliam-husar
Copy link
Author

ping @khepin

@khepin
Copy link
Owner

khepin commented Feb 2, 2013

It's been merged on a "merge" branch.
Needs tests before I merge on master

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants