diff --git a/.gitignore b/.gitignore index 55940e57c..30eab8a47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /vendor/ -composer.lock \ No newline at end of file +composer.lock +Tests/Fixtures/App/app/config/parameters.yml +*~ diff --git a/.travis.yml b/.travis.yml index f45b37f7a..c013209ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,31 +1,29 @@ language: php php: - - 5.5 - - 5.6 - - hhvm-nightly - +- 5.5 +- 5.6 +- hhvm-nightly matrix: allow_failures: - - php: hhvm-nightly - + - php: hhvm-nightly addons: - postgresql: "9.3" - + postgresql: '9.3' sudo: false - -install: - - composer install --dev - - cp Tests/Fixtures/App/config/parameters.travis.yml Tests/Fixtures/App/config/parameters.yml - +install: +- composer config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH +- composer install --dev --no-interaction +- cp Tests/Fixtures/App/config/parameters.travis.yml Tests/Fixtures/App/config/parameters.yml before_script: - - psql -c 'create database test0;' -U postgres - - php Tests/Fixtures/App/console --env=test cache:warmup -# - php Tests/Fixtures/App/console assets:install Tests/Fixtures/App/web - - php Tests/Fixtures/App/console doctrine:schema:create --env=test --no-interaction - - php Tests/Fixtures/App/console doctrine:fixtures:load --env=test --no-interaction - +- psql -c 'create database test0;' -U postgres +- psql -d test0 -c 'CREATE EXTENSION unaccent;' -U postgres +- php Tests/Fixtures/App/app/console --env=test cache:warmup +- php Tests/Fixtures/App/console assets:install Tests/Fixtures/App/web +- php Tests/Fixtures/App/app/console doctrine:migrations:migrate --no-interaction +- php Tests/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction script: phpunit --coverage-text - notifications: email: - - info@champs-libres.coop + - info@champs-libres.coop +env: + global: + secure: WUAweJ9uyCNVQsv8OOD5jofcxSlRLHbI9HBsDDdSuPVLhCcJCLRdQ312wtn5ckfy3pe+aKaijrM/rhd0NQ6lwCkcYAXcikug9k5tf2BJ0H7AJnqe56/cQSrXvxV8n6L1S2xk4AugG/k6PngZQeca5k/34jJ9ViI06V2+r4UrL7w= diff --git a/Tests/Fixtures/App/AppKernel.php b/Tests/Fixtures/App/app/AppKernel.php similarity index 93% rename from Tests/Fixtures/App/AppKernel.php rename to Tests/Fixtures/App/app/AppKernel.php index 0f63f79bb..c77c6e886 100644 --- a/Tests/Fixtures/App/AppKernel.php +++ b/Tests/Fixtures/App/app/AppKernel.php @@ -2,7 +2,6 @@ use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; -use Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle; class AppKernel extends Kernel { @@ -18,7 +17,8 @@ class AppKernel extends Kernel new Chill\PersonBundle\ChillPersonBundle(), new \Symfony\Bundle\AsseticBundle\AsseticBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), - new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle() + new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), + new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle() ); } diff --git a/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore b/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/Tests/Fixtures/App/config/config.yml b/Tests/Fixtures/App/app/config/config.yml similarity index 100% rename from Tests/Fixtures/App/config/config.yml rename to Tests/Fixtures/App/app/config/config.yml diff --git a/Tests/Fixtures/App/config/config_dev.yml b/Tests/Fixtures/App/app/config/config_dev.yml similarity index 100% rename from Tests/Fixtures/App/config/config_dev.yml rename to Tests/Fixtures/App/app/config/config_dev.yml diff --git a/Tests/Fixtures/App/config/config_test.yml b/Tests/Fixtures/App/app/config/config_test.yml similarity index 100% rename from Tests/Fixtures/App/config/config_test.yml rename to Tests/Fixtures/App/app/config/config_test.yml diff --git a/Tests/Fixtures/App/config/parameters.travis.yml b/Tests/Fixtures/App/app/config/parameters.travis.yml similarity index 100% rename from Tests/Fixtures/App/config/parameters.travis.yml rename to Tests/Fixtures/App/app/config/parameters.travis.yml diff --git a/Tests/Fixtures/App/config/parameters.yml.dist b/Tests/Fixtures/App/app/config/parameters.yml.dist similarity index 100% rename from Tests/Fixtures/App/config/parameters.yml.dist rename to Tests/Fixtures/App/app/config/parameters.yml.dist diff --git a/Tests/Fixtures/App/config/routing.yml b/Tests/Fixtures/App/app/config/routing.yml similarity index 100% rename from Tests/Fixtures/App/config/routing.yml rename to Tests/Fixtures/App/app/config/routing.yml diff --git a/Tests/Fixtures/App/console b/Tests/Fixtures/App/app/console similarity index 94% rename from Tests/Fixtures/App/console rename to Tests/Fixtures/App/app/console index 2b45f964b..07f73fd68 100644 --- a/Tests/Fixtures/App/console +++ b/Tests/Fixtures/App/app/console @@ -7,7 +7,7 @@ set_time_limit(0); -require_once __DIR__.'/../../bootstrap.php'; +require_once __DIR__.'/../../../bootstrap.php'; require_once __DIR__.'/AppKernel.php'; use Symfony\Bundle\FrameworkBundle\Console\Application; diff --git a/Tests/Fixtures/App/config/parameters.yml b/Tests/Fixtures/App/config/parameters.yml deleted file mode 100644 index b99abd1b9..000000000 --- a/Tests/Fixtures/App/config/parameters.yml +++ /dev/null @@ -1,7 +0,0 @@ -parameters: - database_host: 127.0.0.1 - database_port: 5435 - database_name: chill - database_user: chill - database_password: chill - locale: fr \ No newline at end of file diff --git a/Tests/Fixtures/App/web/.gitignore b/Tests/Fixtures/App/web/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/Tests/Fixtures/App/web/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/composer.json b/composer.json index 3e647e63a..f21b829f5 100644 --- a/composer.json +++ b/composer.json @@ -28,10 +28,24 @@ "doctrine/doctrine-bundle": "~1.2", "chill-project/main": "dev-master@dev", "chill-project/custom-fields": "dev-master@dev", - "chill-project/person": "dev-master@dev" + "chill-project/person": "dev-master@dev", + "champs-libres/composer-bundle-migration": "~1.0", + "doctrine/doctrine-migrations-bundle": "dev-master@dev", + "doctrine/migrations": "~1.0@dev" }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "~2.2", "fzaninotto/faker": "~1" + }, + "scripts": { + "post-install-cmd": [ + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + ], + "post-update-cmd": [ + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + ] + }, + "extra": { + "app-migrations-dir": "Tests/Fixtures/App/app/DoctrineMigrations" } }