196 search results

…able to create Foundry factories in your project. However, if you already have the foundry installed in your project - than `make:factory` will just work for you, so no need to run that `composer require --dev factory`. Moreover, if you have Foundry lib already installed…
Blog
SymfonyCasts November Open Source Roundup!

…object to another! SymfonyCasts/dynamic-forms: v0.1.3 Add dynamic/dependent fields to Symfony forms zenstruck/phpmyadmin-server: v1.9.0 Run phpMyAdmin in the background with a PHP webserver zenstruck/foundry: v2.2.2 A model factory library for creating expressive, auto-completable…

By Leannapelham

Read Full Post
…as it comes to this module where we have the first access to DB, DB access fails complete. It is that the whole zenstruck part is depecreated and not working anymore with zenstruck/foundry >= ^2. I do not see any database item at all.
Blog
Kevin Bond (aka Zenstruck) joins SymfonyCasts

…to use his libraries and has repeatedly taken a hard or ugly task in Symfony and made it easy and beautiful. Just look at Foundry (for data fixtures - including inside tests), zenstruck/browser (for functional tests) or a number of other libraries for testing emails…

By Leannapelham

Read Full Post
…in your app, have other classes that have nothing to do with Foundry but which follow the factory pattern. Unless it's confusing for you, there is nothing wrong with having non-Foundry classes that also live in `src/Factory/`. If you don't like…
weaverryan
weaverryan
Read Full Comment
…of Foundry, I had add trait of ResetDatabase and Factories to the fixture-tests, because a single RoleFactory call had some problems with $entitymanager->flush(). After adding the traits my test-code was running very slowly and interrupted. So I stopped my experiment with Foundry…
…objects I'm looking for. Or use foundry to find random items - e.g. ``` ProductFactory::createOne([ 'category' => CategoryFactory::random() ]); ``` But, to answer your question.... yes and no! :p. The answer is no. But, that's actually by design. With Foundry, you are still using…
weaverryan
weaverryan
Read Full Comment
… use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Zenstruck\Foundry\ModelFactory; use Zenstruck\Foundry\Proxy; use Zenstruck\Foundry\RepositoryProxy; /** * @extends ModelFactory * * @method User|Proxy create(array|callable $attributes = []) * @method static User|Proxy createOne(array $attributes = []) * @method static User|Proxy find(object|array|mixed $criteria) * @method static User|Proxy findOrCreate(array $attributes…
…User::class; } } ``` They key thing is your `User` class needs to have a getter and setter for `User::address` and `Address` of course needs getters/setters for it's respective properties. Then you just use foundry as you would with any other entity. E.g…
Jesse-Rushlow
Jesse-Rushlow
Read Full Comment
…generate data with it? Are those data really localized? If so, it sounds like a misconfiguration or a bug in the Foundry bundle, I'd recommend you to open an issue there. Btw, keep in mind that not all the data might be translated. Please…
…it required to download somewhere the language packs? ``` Current configuration for extension with alias "zenstruck_foundry" ================================================================== zenstruck_foundry: auto_refresh_proxies: true faker: locale: fr_FR seed: null service: null instantiator: without_constructor: false allow_extra_attributes: false always_force_properties: false service: null ```
…please, make sure your current config really has that locally, you can debug it with: ```bash bin/console debug:config zenstruck_foundry ``` Is the locale set there? Also, make sure you're debugging this config for the environment that your Symfony application is currently using…
…the course code for this tutorial *is* now old - we'll update the tutorials soon for API Platform 3. Also, in newer projects, instead of Alice, we use Foundry for data fixtures and for resetting the database between tests - https://github.com/zenstruck/foundry Cheers!
weaverryan
weaverryan
Read Full Comment
…part where it needs to be holistic. As an exercise I'm also working on integrating zenstruck/foundry and upgrading the security as that all changed in 5.3. Currently the javascript seems to be a bit broken, this needs the liip_imagine bundle and…
…my own constructor. I realise now that it's a good idea to diff my files with the start files to check on updates that are there because of deprecations etc. There is no use statement for Zenstruck\Foundry\Proxy in the course. The error…
… Lesson learned! I kept getting a badly worded error: "User Deprecated: Since zenstruck/foundry 1.7: Calling instance method "App\Factory\QuestionFactory::createMany()" is deprecated and will be removed in 2.0, use the static "App\Factory\QuestionFactory:createMany()" method instead. If you're adding…
…below. In particular look at the single colon in the preferred method which otherwise looks exactly the same as the deprecated one. User Deprecated: Since zenstruck/foundry 1.7: Calling instance method "App\Factory\QuestionFactory::createMany()" is deprecated and will be removed in 2.0…
…from the test/monolog.yaml file. Here's an example from a different library about how to do that: https://github.com/symfony/recipes/blob/master/zenstruck/foundry/1.9/config/packages/test/zenstruck_foundry.yaml > I'm enjoying BDD, but without my logger…
weaverryan
weaverryan
Read Full Comment
…other storing mechanism About your second question. Yes, Foundry will not be installed in your production server because it's a dev dependency, so you should not depend on it but in your tests or data fixtures. If you're having problems with classes using…
MolloKhan
MolloKhan
Read Full Comment
…) 2) Since I now want to use FOUNDRY, I run into trouble, because my "PersonFactory.php" already exists in the "Factory"-folder. But if I understand the concept of FOUNDRY correct these classes will never run on production (class extentions like 'ModelFactory' will not be…