178 search results

Upgrading Encore and your assets/ Setup

…fixed all of the conflicts... and commit! Now, dear friends, we are on the last update. It's zenstruck/foundry. This is an easy one. Run: git status It is, once again, environment configuration going into a main file. So let's commit that. And..…

8:22
18 lines | config/packages/zenstruck_foundry.yaml
when@dev: &dev
// ... line 2
zenstruck_foundry:
enable_auto_refresh_with_lazy_objects: true
// ... lines 5 - 18
See Code Block in Script
so foundry generates a "Factory", so what do I call my acctual (non fixtures) factories then? Or is a foundry factory supposed to be used (i.e. replace my existing entity factories?) for generating non-fixtures also? It's a bit confusing.
// ... lines 1 - 5
use Zenstruck\Foundry\Test\ResetDatabase;
class LemonSqueezyRequestParserTest extends WebTestCase
{
use ResetDatabase;
// ... lines 11 - 18
}
See Code Block in Script
// ... lines 1 - 8
use Zenstruck\Foundry\Test\Factories;
use Zenstruck\Foundry\Test\ResetDatabase;
// ... line 11
class LockDownRepositoryTest extends KernelTestCase
{
use ResetDatabase, Factories;
// ... lines 15 - 42
}
See Code Block in Script
I tried using foundry, but it's not clear how to override the createOne method (if you need to do some custom work). Is there somewhere that has more comprehensive information on how to use this? It would be great if you guys had some…
// ... 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 ?
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
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…