Skip to content

Commit

Permalink
Add examples using the new test class, remove Behat, fix some depreca…
Browse files Browse the repository at this point in the history
…tions (#129)

* Add examples using the new test class, remove Behat, fix some deprecations.

* Review
  • Loading branch information
dunglas committed Sep 23, 2019
1 parent f359854 commit 86127d6
Show file tree
Hide file tree
Showing 23 changed files with 858 additions and 1,420 deletions.
5 changes: 5 additions & 0 deletions api/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
23 changes: 15 additions & 8 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/helm/api/charts
/helm/api/requirements.lock
/coverage

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
Expand All @@ -7,14 +11,17 @@
/vendor/
###< symfony/framework-bundle ###

###> behat/symfony2-extension ###
behat.yml
###< behat/symfony2-extension ###

/helm/api/charts
/helm/api/requirements.lock
/coverage

###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem
###< lexik/jwt-authentication-bundle ###

###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

###> friendsofphp/php-cs-fixer ###
/.php_cs
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###
1 change: 0 additions & 1 deletion api/.php_cs.cache

This file was deleted.

14 changes: 14 additions & 0 deletions api/.php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('var')
;

return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
])
->setFinder($finder)
;
3 changes: 3 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY docker/php/php.ini /usr/local/etc/php/php.ini

# Workaround to allow using PHPUnit 8 with Symfony 4.3
ENV SYMFONY_PHPUNIT_VERSION=8.3

# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
# install Symfony Flex globally to speed up download of Composer packages (parallelized prefetching)
Expand Down
48 changes: 0 additions & 48 deletions api/behat.yml.dist

This file was deleted.

13 changes: 13 additions & 0 deletions api/bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env php
<?php

if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
11 changes: 4 additions & 7 deletions api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ext-ctype": "*",
"ext-iconv": "*",
"api-platform/api-pack": "^1.1",
"api-platform/core": "2.5.x-dev",
"api-platform/core": "^2.5@dev",
"doctrine/doctrine-migrations-bundle": "^2.0",
"guzzlehttp/guzzle": "^6.3",
"lexik/jwt-authentication-bundle": "^2.6",
Expand All @@ -22,16 +22,13 @@
"webonyx/graphql-php": "^0.13"
},
"require-dev": {
"behat/behat": "^3.4",
"behat/mink": "^1.7",
"behat/mink-browserkit-driver": "^1.3",
"behat/mink-extension": "^2.3",
"behat/symfony2-extension": "^2.1.4",
"behatch/contexts": "^3.0",
"friendsofphp/php-cs-fixer": "^2.15",
"hautelook/alice-bundle": "^2.3",
"justinrainbow/json-schema": "^5.2",
"phpunit/php-code-coverage": "^7.0",
"symfony/maker-bundle": "^1.11",
"symfony/profiler-pack": "^1.0",
"symfony/test-pack": "^1.0",
"symfony/var-dumper": "4.3.*"
},
"config": {
Expand Down
Loading

0 comments on commit 86127d6

Please sign in to comment.