Skip to content

Commit 0e306b6

Browse files
authored
Merge pull request #20 from TomHAnderson/feature/data-fixtures
Feature/data fixtures
2 parents 9dc63fc + 547d85e commit 0e306b6

File tree

5 files changed

+181
-1
lines changed

5 files changed

+181
-1
lines changed

.github/workflows/ldog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ jobs:
8181
env:
8282
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
8383

84+
- name: Import Fixturess
85+
run: php artisan doctrine:data-fixtures:import default
86+
env:
87+
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
88+
8489
- name: Test Code Quality
8590
run: composer test
8691
env:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ Documentation
3333
* GraphQL-php - https://webonyx.github.io/graphql-php/
3434
* magidoc - https://magidoc.js.org/introduction/welcome
3535
* graphiql - https://github.com/graphql/graphiql/blob/main/packages/graphiql/README.md
36+
* migrations - https://laraveldoctrine.org/docs/1.8/migrations
37+
* data fixtures - https://github.com/API-Skeletons/laravel-doctrine-data-fixtures/blob/main/README.md

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"require": {
88
"php": "^8.3",
99
"api-skeletons/doctrine-orm-graphql": "^10.2",
10+
"api-skeletons/laravel-doctrine-data-fixtures": "^1.0",
1011
"guzzlehttp/guzzle": "^7.2",
1112
"laravel-doctrine/migrations": "^3.1",
1213
"laravel-doctrine/orm": "^2.0",

composer.lock

Lines changed: 142 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/doctrine-data-fixtures.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
6+
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
7+
8+
/**
9+
* In the default values listed below, ORM fixtures are configured. You may
10+
* configure other Doctrine fixture group types:
11+
*
12+
* ORMExecutor | PHPCRExecutor | MongoDBExecutor
13+
* ORMPurger | PHPCRPurger | MongoDBPurger
14+
*/
15+
16+
// The order of fixtures in the fixtures array is not the order in which
17+
// they will be executed. See
18+
// https://github.com/doctrine/data-fixtures#fixture-ordering
19+
/**
20+
Fixture1::class,
21+
Fixture2::class,
22+
*/
23+
24+
return [
25+
'default' => [ // Group name
26+
'objectManager' => 'Doctrine\ORM\EntityManager',
27+
'executor' => ORMExecutor::class,
28+
'purger' => ORMPurger::class,
29+
'fixtures' => [],
30+
],
31+
];

0 commit comments

Comments
 (0)