201 search results

// ... lines 1 - 4
use Zenstruck\Foundry\Test\Factories;
use Zenstruck\Foundry\Test\ResetDatabase;
class DailyQuestResourceTest extends ApiTestCase
{
use ResetDatabase;
use Factories;
}
See Code Block in Script
79 lines | composer.json
{
// ... lines 2 - 3
"require": {
// ... lines 5 - 29
"zenstruck/foundry": "^1.1"
},
// ... lines 32 - 77
}
See Code Block in Script
whats is Foundry O.o ?
…hoping that Foundry had something similar to: ``` doctrine:fixtures:load --purge-exclusions=doctrine_migrations_versions ``` Or even maybe something in the configuration to exclude tables. I believe Doctrine has a way to create your own Purger class so you can control it. Does Foundry have something…
JeffJones
JeffJones
Read Full Comment
ModelFactory has been deprecated in zenstruck/foundry from version 2 so the addState method in the tutorial does not exist anymore. Anyway it is safe to use: `$admin = UserFactory::createOne((['roles' => ['ROLE_ADMIN']]));`
Abraham-C
Abraham-C
Read Full Comment
Missed global goal of this lesson - Foundry just help to set database with fake data?
Hey sciro - I'm the creator of foundry. To be clear, the code does work as expected and this is only a PHPStorm warning? I'm also using PHPStorm and I don't see this - what version (of PHPStorm) are you on? The issue is…
Hey Utilisateur The latest version of Foundry allows defining "factories as services" so you now can inject the password encoder service into your `UserFactory`. The example in the docs shows just that. Ryan's suggestion of pre-encoding the password is still my preferred method…
So if I see this right zenstruck/foundry acts as a replacement for the hautelook/AliceBundle dependency which is currently incompatible with api-platform 2.5.7? And is there a reason why zenstruck/foundry and the doctrine-fixtures-bundle isn't just a require…
Taminoful
Taminoful
Read Full Comment
Thank you for the link to Foundy. Will check it out.
sridharpandu
sridharpandu
Read Full Comment
So I tried adding the reset mode migrate to the zenstruck_foundry.yaml ``` when@dev: &dev # See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration zenstruck_foundry: persistence: # Flush only once per call of `PersistentObjectFactory::create()` flush_once: true…
JeffJones
JeffJones
Read Full Comment
…chapter’s fixture user is created by Foundry, so an empty `user` table usually means the fixtures story never ran, not that Doctrine is broken. Run the story loader explicitly so `AppStory` inserts `picard@enterprise.space` into the database: ```terminal symfony console foundry:load-fixtures ```…
…foundry 2 added a bunch of breaking changes - there is a [migration path for 1.x-2.x](https://github.com/zenstruck/foundry/blob/2.x/UPGRADE-2.0.md) you can take a look at. In the meantime, no problem staying on foundry 1…
I'm getting some strange deprecation warnings from (it appears: ) foundry: 09:55:55 INFO [deprecation] User Deprecated: Method Doctrine\ORM\Event\LifecycleEventArgs::getEntityManager() is deprecated and will be removed in Doctrine ORM 3.0. Use getObjectManager() instead. (LifecycleEventArgs.php:63 called by ORM.php…
Thanks, i renamed foundry namespace from 'factory' to 'foundry' to keep it seperate from factories that do a better job building non-fixture entities.
I must install this bundle -> `composer require zenstruck/foundry --dev`
pasquale_pellicani
pasquale_pellicani
Read Full Comment
Hi, is it possible to use references in Foundry? Earlier, I used setReference in Fixtures (inherited from AbstractFixture($this->setReference('key', $object))) and could refer to special objects like roles. Does Foundry have a similar feature (getReference('key')) for this case which I can use…
Hey Tien dat L. Foundry is expecting the Question class to have a way to set the tags, in this case it's expecting a public `setTags()` method. Could you check if that method exist? Cheers!
MolloKhan
MolloKhan
Read Full Comment
Hey Brainiac, Yes, Foundry definitely adds more overhead into your project than just simple fixtures, but it also provides more features out of the box. To know more about the features it brings - please, watch this screencast. Also, in the next video we cover some…
// ... lines 1 - 4
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Zenstruck\Foundry\Test\Factories;
use Zenstruck\Foundry\Test\ResetDatabase;
class LockDownHelperTest extends KernelTestCase
{
use ResetDatabase, Factories;
}
See Code Block in Script