diff --git a/makefile b/makefile index 8898584..157084a 100644 --- a/makefile +++ b/makefile @@ -38,7 +38,7 @@ restart: env-init $(DOCKER_COMPOSE) down CURRENT_UID=$(shell id -u) CURRENT_GID=$(shell id -g) $(DOCKER_COMPOSE) up -d -install: copy-git-hook composer-install cache-clear node-use build-nuxtJS migration-migrate +install: copy-git-hook composer-install cache-clear node-use build-nuxtJS migration-migrate test-db-setup # Supprime tout est réinstalle tout (Attention ça supprime la bdd aussi) reset: delete_built_dir remove_orphans build-without-cache start wait install @@ -83,6 +83,15 @@ build-without-cache: migration-migrate: $(SYMFONY_CONSOLE) doctrine:migrations:migrate --no-interaction +# Cree et initialise la base de test utilisee par PHPUnit +# (le suffixe "_test" est applique automatiquement par Doctrine en APP_ENV=test) +# Ordre : fixtures -> sync-permissions, car fixtures:load purge la table permission +test-db-setup: + $(SYMFONY_CONSOLE) doctrine:database:create --env=test --if-not-exists + $(SYMFONY_CONSOLE) doctrine:migrations:migrate --env=test --no-interaction + $(SYMFONY_CONSOLE) --env=test --no-interaction doctrine:fixtures:load + $(SYMFONY_CONSOLE) --env=test --no-interaction app:sync-permissions + fixtures: $(SYMFONY_CONSOLE) --no-interaction doctrine:fixtures:load @@ -100,6 +109,7 @@ db-reset: $(MAKE) migration-migrate $(MAKE) fixtures $(MAKE) sync-permissions + $(MAKE) test-db-setup # Restart la bdd db-restart: