orm icon indicating copy to clipboard operation
orm copied to clipboard

[FEATURE]New database factory system

Open k0ka opened this issue 3 years ago • 6 comments

Changes proposed in this pull request:

The new database factory system is added, it was copied from the Laravel Eloquent modern factories https://laravel.com/docs/9.x/database-testing Everything except Factory relationships has been implemented and works for Doctrine.

The new system is object-oriented, easily extensible, doesn't use any magic files and supports IDE autocompletion.

image

Fixes #470

Changes to be done

Please let me know if this PR looks good, and I'll add documentation (actually copy-paste it from the Laravel).

The current implementation of database factories

While Laravel moved the old factory system into another package laravel/legacy-factories, we might leave it for backward compatibility as both systems can coexist without any problem.

k0ka avatar Aug 06 '22 21:08 k0ka

Codecov Report

Merging #526 (3b4b43a) into 1.8 (9eea57d) will increase coverage by 0.82%. The diff coverage is 66.28%.

@@             Coverage Diff              @@
##                1.8     #526      +/-   ##
============================================
+ Coverage     54.49%   55.32%   +0.82%     
- Complexity      824      889      +65     
============================================
  Files           101      103       +2     
  Lines          2325     2500     +175     
============================================
+ Hits           1267     1383     +116     
- Misses         1058     1117      +59     
Impacted Files Coverage Δ
src/Testing/Factories/Factory.php 66.27% <66.27%> (ø)
src/Testing/Factories/HasEntityFactory.php 66.66% <66.66%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 06 '22 21:08 codecov-commenter

Looks good to me

eigan avatar Aug 15 '22 07:08 eigan

Please let me know if you have any questions or need any assistance from me.

k0ka avatar Oct 03 '22 14:10 k0ka

Any news regarding this? should be awesome to have this running....

esteban-serfe avatar Nov 10 '23 19:11 esteban-serfe

Hey all, I'm new to laravel-doctrine but love having good testing utilities. Is there anything we can do to help move this along?

ncphillips avatar Jan 24 '24 00:01 ncphillips