Skip to content

Commit

Permalink
Enhancement: Import breerly/factory-girl
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Mar 8, 2020
1 parent fa9c564 commit 151596c
Show file tree
Hide file tree
Showing 56 changed files with 6,742 additions and 580 deletions.
9 changes: 9 additions & 0 deletions .dependabot/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ update_configs:
default_labels:
- "dependency"
directory: "/"
ignored_updates:
- match:
dependency_name: "doctrine/annotations"
- match:
dependency_name: "doctrine/collections"
- match:
dependency_name: "doctrine/dbal"
- match:
dependency_name: "doctrine/orm"
package_manager: "php:composer"
update_schedule: "live"
version_requirement_updates: "increase_versions"
11 changes: 8 additions & 3 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on: # yamllint disable-line rule:truthy
- "master"

env:
MIN_COVERED_MSI: 100
MIN_MSI: 100
MIN_COVERED_MSI: 65
MIN_MSI: 59
REQUIRED_PHP_EXTENSIONS: "mbstring"

jobs:
Expand Down Expand Up @@ -136,6 +136,8 @@ jobs:

- name: "Run maglnet/composer-require-checker"
uses: "docker://webfactory/composer-require-checker:2.1.0"
with:
args: "check --config-file=composer-require-checker.json"

static-code-analysis:
name: "Static Code Analysis"
Expand Down Expand Up @@ -250,6 +252,9 @@ jobs:
- name: "Run auto-review tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml"

- name: "Run doctrine tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/Doctrine/phpunit.xml"

- name: "Run unit tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml"

Expand Down Expand Up @@ -304,7 +309,7 @@ jobs:
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Collect code coverage with pcov and phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=.build/logs/clover.xml"
run: "vendor/bin/phpunit --configuration=test/Doctrine/phpunit.xml --coverage-clover=.build/logs/clover.xml"

- name: "Send code coverage report to Codecov.io"
env:
Expand Down
2 changes: 2 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ $config->getFinder()
'.build/',
'.dependabot/',
'.github/',
'src/Doctrine/',
'test/Doctrine/',
])
->name('.php_cs');

Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
MIN_COVERED_MSI:=100
MIN_MSI:=100
MIN_COVERED_MSI:=65
MIN_MSI:=59

.PHONY: it
it: coding-standards dependency-analysis static-code-analysis tests ## Runs the coding-standards, dependency-analysis, static-code-analysis, and tests targets

.PHONY: code-coverage
code-coverage: vendor ## Collects coverage from running unit tests with phpunit/phpunit
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text
vendor/bin/phpunit --configuration=test/Doctrine/phpunit.xml --coverage-text

.PHONY: coding-standards
coding-standards: vendor ## Fixes code style issues with friendsofphp/php-cs-fixer
Expand All @@ -16,7 +16,7 @@ coding-standards: vendor ## Fixes code style issues with friendsofphp/php-cs-fix

.PHONY: dependency-analysis
dependency-analysis: vendor ## Runs a dependency analysis with maglnet/composer-require-checker
docker run --interactive --rm --tty --volume ${PWD}:/app webfactory/composer-require-checker:2.1.0
docker run --interactive --rm --tty --volume ${PWD}:/app webfactory/composer-require-checker:2.1.0 check --config-file=composer-require-checker.json

.PHONY: help
help: ## Displays this list of targets with descriptions
Expand Down Expand Up @@ -46,6 +46,7 @@ static-code-analysis-baseline: vendor ## Generates a baseline for static code an
tests: vendor ## Runs auto-review, unit, and integration tests with phpunit/phpunit
mkdir -p .build/phpunit
vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml
vendor/bin/phpunit --configuration=test/Doctrine/phpunit.xml
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml
vendor/bin/phpunit --configuration=test/Integration/phpunit.xml

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Please have a look at [`LICENSE.md`](LICENSE.md).

## Credits

This project is inspired by [`breerly/factory-girl-php`](https://github.com/unhashable/factory-girl-php) (originally licensed under MIT by [Grayson Koonce](https://github.com/unhashable)), which is based on [`xi/doctrine`](https://github.com/xi-project/xi-doctrine) (originally licensed under MIT by [Xi](https://github.com/xi-project)), which in turn provided a port of [`factory_bot`](https://github.com/thoughtbot/factory_girl) (originally licensed under MIT by [Joe Ferris](https://github.com/jferris) and [thoughtbot, Inc.](https://github.com/thoughtbot)).
This project is based on [`breerly/factory-girl-php@0e6f1b6`](https://github.com/unhashable/factory-girl-php/tree/0e6f1b6724d39108a2e7cef68a74668b7a77b856) (originally licensed under MIT by [Grayson Koonce](https://github.com/unhashable)), which is based on [`xi/doctrine`](https://github.com/xi-project/xi-doctrine) (originally licensed under MIT by [Xi](https://github.com/xi-project)), which in turn provided a port of [`factory_bot`](https://github.com/thoughtbot/factory_girl) (originally licensed under MIT by [Joe Ferris](https://github.com/jferris) and [thoughtbot, Inc.](https://github.com/thoughtbot)).
21 changes: 21 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"symbol-whitelist" : [
"array",
"bool",
"callable",
"false",
"float",
"int",
"iterable",
"null",
"object",
"parent",
"self",
"static",
"string",
"true",
"void",
"FactoryGirl\\Provider\\Doctrine\\ORM\\Exception",
"FactoryGirl\\Provider\\Doctrine\\ORM\\Locking\\Exception"
]
}
15 changes: 12 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
}
],
"require": {
"php": "^7.2"
"php": "^7.2",
"doctrine/annotations": "^1.7.0",
"doctrine/collections": "^1.0.0",
"doctrine/dbal": "^2.2.1",
"doctrine/orm": "^2.6.3"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.2.4",
Expand All @@ -35,6 +39,9 @@
"psalm/plugin-phpunit": "~0.9.0",
"vimeo/psalm": "^3.9.4"
},
"suggest": {
"fzaninotto/faker": "For generating fake data in entity definitions"
},
"config": {
"platform": {
"php": "7.2.25"
Expand All @@ -44,12 +51,14 @@
},
"autoload": {
"psr-4": {
"Ergebnis\\FactoryBot\\": "src/"
"Ergebnis\\FactoryBot\\": "src/",
"FactoryGirl\\Provider\\Doctrine\\": "src/Doctrine/"
}
},
"autoload-dev": {
"psr-4": {
"Ergebnis\\FactoryBot\\Test\\": "test/"
"Ergebnis\\FactoryBot\\Test\\": "test/",
"FactoryGirl\\Tests\\Provider\\Doctrine\\": "test/Doctrine/"
}
},
"support": {
Expand Down
Loading

0 comments on commit 151596c

Please sign in to comment.