196 search results
Learn Symfony
Symfony Security: The Basics
…we're creating his user. Add 'roles' => , and in an array, ROLE_CAPTAIN: At your terminal, reload the fixtures with: symfony console foundry:load-fixtures Reload the page... we're logged out because we reloaded the fixtures. Log back in... Nice, we're in…
Upgrading to Symfony 8
…from Doctrine. We'll have a whole chapter on upgrading Doctrine a little later, so we'll ignore these for now. The fourth one is a deprecated config option from zenstruck/foundry. Before manually fixing this, let's first update our Symfony Flex recipes. Sometimes…
…from the terminal and open src/Story/AppStory.php. Replace the plain text password for makeitso with the copied hash: Back in the terminal, reload our fixtures with: symfony console foundry:load-fixtures Go back to our login page... refresh... enter makeitso as the password..…
Doctrine, Symfony 7 & the Database
…second is the findAll() from findMyShip(). Perfect! Next, let's improve our fixtures and make them 100 times more fun with a library called Foundry. This will let us create a whole fleet of Starships as if we had a replicator. Let's do it!
Learn Doctrine
Doctrine Inheritance: Class Hierarchy in the Database
…scout. Let's see how this plays out when we reload the fixtures for our app. Run: symfony console foundry:load-fixtures Here's a snag: we can't instantiate the abstract class Starship. We're using Foundry factories, and since Starship is now abstract…
Pro Testing
PHPUnit: Integration Testing with Live Services
…created the $lockDown variable through Foundry, it's wrapped in a Proxy. One of the main features of a Proxy is called "auto-refreshing". Each time you access a property or call a method on your entity, behind the scenes, Foundry queries for the latest…
Learn APIs
API Platform 3 Part 2: Security for your Treasures
…But that's way too much work. Instead, add one more trait to our test class: use ResetDatabase: This comes from Foundry: the library we've been using to create dummy fixtures via the factory classes. ResetDatabase is amazing. It automatically makes sure that the…
API Platform 3 Part 3: Custom Resources
… At the end of the test, say NotificationFactory - that's a Foundry factory that I created, ::repository() - to get a repository helper - then ->assert()->count(1). With Foundry, our database is always empty at the start of a test: so checking for 1 row is…
Learn Symfony 6
Upgrading & What's New in Symfony 6!
…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..…
Learn Symfony 5
Doctrine, Symfony & the Database
…especially once you have database relationships where objects are linked to other objects... these classes can get ugly fast. And they're not much fun to write. So, next: let's use a shiny new library called Foundry to create numerous, random, rich dummy data.
PHP 8.4 & Recipe Updates
Doctrine, Symfony 6 & the Database
Foundry: Fixtures You'll Love
Lemon Squeezy Payment Processor
Writing an Integrational Test for Webhooks
Resetting the Database
Custom Resource State Processor
API Platform 2 Part 3: Custom Resources
App & Test Setup
Creating the User Class
Allow Admin Users to Edit any Treasure
Whoops, an error! Please, try again later.