Enviar pesquisa
Carregar
Doctrine fixtures
•
1 gostou
•
5,037 visualizações
Bill Chang
Seguir
Tecnologia
Espiritual
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 12
Baixar agora
Baixar para ler offline
Recomendados
Symfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il cliente
Leonardo Proietti
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5
Leonardo Proietti
Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et Pimple
Hugo Hamon
The History of PHPersistence
The History of PHPersistence
Hugo Hamon
Database Design Patterns
Database Design Patterns
Hugo Hamon
Silex meets SOAP & REST
Silex meets SOAP & REST
Hugo Hamon
The Zen of Lithium
The Zen of Lithium
Nate Abele
The Origin of Lithium
The Origin of Lithium
Nate Abele
Recomendados
Symfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il cliente
Leonardo Proietti
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5
Leonardo Proietti
Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et Pimple
Hugo Hamon
The History of PHPersistence
The History of PHPersistence
Hugo Hamon
Database Design Patterns
Database Design Patterns
Hugo Hamon
Silex meets SOAP & REST
Silex meets SOAP & REST
Hugo Hamon
The Zen of Lithium
The Zen of Lithium
Nate Abele
The Origin of Lithium
The Origin of Lithium
Nate Abele
Lithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate Frameworks
Nate Abele
Design how your objects talk through mocking
Design how your objects talk through mocking
Konstantin Kudryashov
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
Ross Tuck
PHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php framework
G Woo
Dependency Injection IPC 201
Dependency Injection IPC 201
Fabien Potencier
Doctrine For Beginners
Doctrine For Beginners
Jonathan Wage
Crafting beautiful software
Crafting beautiful software
Jorn Oomen
Command Bus To Awesome Town
Command Bus To Awesome Town
Ross Tuck
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
Fabien Potencier
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
Kacper Gunia
Decoupling the Ulabox.com monolith. From CRUD to DDD
Decoupling the Ulabox.com monolith. From CRUD to DDD
Aleix Vergés
Building Lithium Apps
Building Lithium Apps
Nate Abele
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
Konstantin Kudryashov
Agile database access with CakePHP 3
Agile database access with CakePHP 3
José Lorenzo Rodríguez Urdaneta
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
Kris Wallsmith
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Masahiro Nagano
Dependency injection-zendcon-2010
Dependency injection-zendcon-2010
Fabien Potencier
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Nate Abele
PHP Language Trivia
PHP Language Trivia
Nikita Popov
CQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony application
Samuel ROZE
Coming to Terms with OOP In Drupal - php[world] 2016
Coming to Terms with OOP In Drupal - php[world] 2016
Chris Tankersley
Dicoding Developer Coaching #27: Android | Membuat Aplikasi Support Online Ma...
Dicoding Developer Coaching #27: Android | Membuat Aplikasi Support Online Ma...
DicodingEvent
Mais conteúdo relacionado
Mais procurados
Lithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate Frameworks
Nate Abele
Design how your objects talk through mocking
Design how your objects talk through mocking
Konstantin Kudryashov
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
Ross Tuck
PHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php framework
G Woo
Dependency Injection IPC 201
Dependency Injection IPC 201
Fabien Potencier
Doctrine For Beginners
Doctrine For Beginners
Jonathan Wage
Crafting beautiful software
Crafting beautiful software
Jorn Oomen
Command Bus To Awesome Town
Command Bus To Awesome Town
Ross Tuck
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
Fabien Potencier
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
Kacper Gunia
Decoupling the Ulabox.com monolith. From CRUD to DDD
Decoupling the Ulabox.com monolith. From CRUD to DDD
Aleix Vergés
Building Lithium Apps
Building Lithium Apps
Nate Abele
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
Konstantin Kudryashov
Agile database access with CakePHP 3
Agile database access with CakePHP 3
José Lorenzo Rodríguez Urdaneta
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
Kris Wallsmith
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Masahiro Nagano
Dependency injection-zendcon-2010
Dependency injection-zendcon-2010
Fabien Potencier
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Nate Abele
PHP Language Trivia
PHP Language Trivia
Nikita Popov
CQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony application
Samuel ROZE
Mais procurados
(20)
Lithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate Frameworks
Design how your objects talk through mocking
Design how your objects talk through mocking
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
PHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php framework
Dependency Injection IPC 201
Dependency Injection IPC 201
Doctrine For Beginners
Doctrine For Beginners
Crafting beautiful software
Crafting beautiful software
Command Bus To Awesome Town
Command Bus To Awesome Town
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
Decoupling the Ulabox.com monolith. From CRUD to DDD
Decoupling the Ulabox.com monolith. From CRUD to DDD
Building Lithium Apps
Building Lithium Apps
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
Agile database access with CakePHP 3
Agile database access with CakePHP 3
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Dependency injection-zendcon-2010
Dependency injection-zendcon-2010
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
PHP Language Trivia
PHP Language Trivia
CQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony application
Semelhante a Doctrine fixtures
Coming to Terms with OOP In Drupal - php[world] 2016
Coming to Terms with OOP In Drupal - php[world] 2016
Chris Tankersley
Dicoding Developer Coaching #27: Android | Membuat Aplikasi Support Online Ma...
Dicoding Developer Coaching #27: Android | Membuat Aplikasi Support Online Ma...
DicodingEvent
Phactory
Phactory
chriskite
Unittests für Dummies
Unittests für Dummies
Lars Jankowfsky
Writing and Publishing Puppet Modules
Writing and Publishing Puppet Modules
Puppet
Dependency injection in Drupal 8
Dependency injection in Drupal 8
Alexei Gorobets
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014
Eric Hogue
Databases and doctrine
Databases and doctrine
Glenn Guden
Auto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK Nodes
nihiliad
Magic methods
Magic methods
Matthew Barlocker
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards
Denis Ristic
vfsStream - a better approach for file system dependent tests
vfsStream - a better approach for file system dependent tests
Frank Kleine
Opps Concept
Opps Concept
F(x) Data Labs Pvt Ltd
Power shell examples_v4
Power shell examples_v4
JoeDinaso
Android Data Storagefinal
Android Data Storagefinal
Nakka Srilakshmi
Introducing PHP Latest Updates
Introducing PHP Latest Updates
Iftekhar Eather
Zend framework 03 - singleton factory data mapper caching logging
Zend framework 03 - singleton factory data mapper caching logging
Tricode (part of Dept)
Introducing PHP Data Objects
Introducing PHP Data Objects
webhostingguy
vfsStream - effective filesystem mocking
vfsStream - effective filesystem mocking
Sebastian Marek
Symfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 Integration
Jonathan Wage
Semelhante a Doctrine fixtures
(20)
Coming to Terms with OOP In Drupal - php[world] 2016
Coming to Terms with OOP In Drupal - php[world] 2016
Dicoding Developer Coaching #27: Android | Membuat Aplikasi Support Online Ma...
Dicoding Developer Coaching #27: Android | Membuat Aplikasi Support Online Ma...
Phactory
Phactory
Unittests für Dummies
Unittests für Dummies
Writing and Publishing Puppet Modules
Writing and Publishing Puppet Modules
Dependency injection in Drupal 8
Dependency injection in Drupal 8
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014
Databases and doctrine
Databases and doctrine
Auto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK Nodes
Magic methods
Magic methods
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards
vfsStream - a better approach for file system dependent tests
vfsStream - a better approach for file system dependent tests
Opps Concept
Opps Concept
Power shell examples_v4
Power shell examples_v4
Android Data Storagefinal
Android Data Storagefinal
Introducing PHP Latest Updates
Introducing PHP Latest Updates
Zend framework 03 - singleton factory data mapper caching logging
Zend framework 03 - singleton factory data mapper caching logging
Introducing PHP Data Objects
Introducing PHP Data Objects
vfsStream - effective filesystem mocking
vfsStream - effective filesystem mocking
Symfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 Integration
Último
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
The Digital Insurer
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Khem
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
lior mazor
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Igalia
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
V3cube
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
Último
(20)
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Doctrine fixtures
1.
Doctrine Fixtures with Fake
Data
2.
Doctrine Fixtures ● Installation ○
composer.json { "require-dev": { "doctrine/doctrine-fixtures-bundle": "dev-master" } } ○ php composer.phar update doctrine/doctrine-fixtures- bundle ○ app/appKernel.php if (in_array($this->getEnvironment(), array('dev', 'test'))) { /* ... other bundles */ $bundles[] = new DoctrineBundleFixturesBundleDoctrineFixturesBundle(); }
3.
DoctrineFixtures Structure ● Source
folder : {BundlesName}DataFixturesORMLoad{EntityName}Data.php ● class naming : Load{EntityName}Data ● extends class: ○ DoctrineCommonDataFixturesAbstractFixture ○ method: Load(DoctrineCommonPersistenceObjectManager $em) ● Implements interface: ○ DoctrineCommonDataFixturesOrderedFixtureInterface ○ method: getOrder() ● Internal method ○ addReference($name,$entityObject); ○ hasReference($name) ○ getReference($name) ● Command: php app/console doctrine:fixtures:load
4.
fzaninotto/Faker ● Installation php composer.phar
require “fzaninotto/faker dev-master” ● Base Usage $faker = FakerFactory::create(); $name = $faker->name; $phone = $faker->phoneNumber; $url = $faker->url;
5.
fzaninotto/Faker - Formats Localation ●
Person ● Address ● Company ● PhoneNumber General ● Lorem ● Internet / UserAgent ● File ● Color ● Uuid ● DateTime ● Base(Random, Regex) ● Miscellaneous ● CreditCard
6.
zaninotto/Faker ● Localization $faker =
FakerFactory::create('en_US'); $faker = FakerFactory::create('fr_FR'); ● Seed $faker = FakerFactory::create(); $faker->seed(1234);
7.
fzaninotto/Faker Unique and Optional
modifiers ● required value $faker->randomDigit; ● non-required values (default 0.5) $faker->optional($weight = 0.1)->randomDigit; // 10% chance to get null $faker->optional($weight = 0.9)->randomDigit; // 90% chance to get null ● unique value(); $faker->unique()->randomDigit; $faker->unique($reset=true)->randomDigit;
8.
fzaninotto/Faker (work with
ORM entity) ● Orm adapters : Propel, Doctrine2, Mandango $generator = FakerFactory::create(); $populator = new FakerORMPropelPopulator($generator); $populator->addEntity('Author', 5); $populator->addEntity('SomeOneBundleEntityBook', 10); $insertedPKs = $populator->execute(); ● Populator by guessing ○ column name ○ column type ○ column length
9.
fzaninotto/Faker (work with
ORM entity) custom populating value ● Null Value $populator->addEntity('Book', 5, array( 'CreatedAt' => null )); ● anonyomous function $populator->addEntity('SomeOneBundleEntityPerson', 10,array( 'birthday' => function() use ($gen) { return $gen->dateTimeBetween($startDate = '-80 years', $endDate = '-10 years')->format("Y-m-d") ; } ));
10.
fzaninotto/Faker ● Internal Provider ○
FakerGenerator ○ FakerFactory::create(); ● Custom Provider
11.
Other Agenda ● Alice
Faker Library ○ https://github.com/nelmio/alice ○ https://github.com/hautelook/AliceBundle ● Image Faker ? ○ http://image-faker.rmhdev.net/ ○ http://fakeimg.pl/
12.
Thank For your
Listenting !
Baixar agora