Skip to content

Commit 86127d6

Browse files
authored
Add examples using the new test class, remove Behat, fix some deprecations (#129)
* Add examples using the new test class, remove Behat, fix some deprecations. * Review
1 parent f359854 commit 86127d6

23 files changed

+858
-1420
lines changed

api/.env.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# define your env variables for the test env here
2+
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'
4+
SYMFONY_DEPRECATIONS_HELPER=999999
5+
PANTHER_APP_ENV=panther

api/.gitignore

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/helm/api/charts
2+
/helm/api/requirements.lock
3+
/coverage
4+
15
###> symfony/framework-bundle ###
26
/.env.local
37
/.env.local.php
@@ -7,14 +11,17 @@
711
/vendor/
812
###< symfony/framework-bundle ###
913

10-
###> behat/symfony2-extension ###
11-
behat.yml
12-
###< behat/symfony2-extension ###
13-
14-
/helm/api/charts
15-
/helm/api/requirements.lock
16-
/coverage
17-
1814
###> lexik/jwt-authentication-bundle ###
1915
/config/jwt/*.pem
2016
###< lexik/jwt-authentication-bundle ###
17+
18+
###> symfony/phpunit-bridge ###
19+
.phpunit
20+
.phpunit.result.cache
21+
/phpunit.xml
22+
###< symfony/phpunit-bridge ###
23+
24+
###> friendsofphp/php-cs-fixer ###
25+
/.php_cs
26+
/.php_cs.cache
27+
###< friendsofphp/php-cs-fixer ###

api/.php_cs.cache

Lines changed: 0 additions & 1 deletion
This file was deleted.

api/.php_cs.dist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__)
5+
->exclude('var')
6+
;
7+
8+
return PhpCsFixer\Config::create()
9+
->setRules([
10+
'@Symfony' => true,
11+
'array_syntax' => ['syntax' => 'short'],
12+
])
13+
->setFinder($finder)
14+
;

api/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
6565
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
6666
COPY docker/php/php.ini /usr/local/etc/php/php.ini
6767

68+
# Workaround to allow using PHPUnit 8 with Symfony 4.3
69+
ENV SYMFONY_PHPUNIT_VERSION=8.3
70+
6871
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
6972
ENV COMPOSER_ALLOW_SUPERUSER=1
7073
# install Symfony Flex globally to speed up download of Composer packages (parallelized prefetching)

api/behat.yml.dist

Lines changed: 0 additions & 48 deletions
This file was deleted.

api/bin/phpunit

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
5+
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
6+
exit(1);
7+
}
8+
9+
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
10+
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
11+
}
12+
13+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';

api/composer.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ext-ctype": "*",
77
"ext-iconv": "*",
88
"api-platform/api-pack": "^1.1",
9-
"api-platform/core": "2.5.x-dev",
9+
"api-platform/core": "^2.5@dev",
1010
"doctrine/doctrine-migrations-bundle": "^2.0",
1111
"guzzlehttp/guzzle": "^6.3",
1212
"lexik/jwt-authentication-bundle": "^2.6",
@@ -22,16 +22,13 @@
2222
"webonyx/graphql-php": "^0.13"
2323
},
2424
"require-dev": {
25-
"behat/behat": "^3.4",
26-
"behat/mink": "^1.7",
27-
"behat/mink-browserkit-driver": "^1.3",
28-
"behat/mink-extension": "^2.3",
29-
"behat/symfony2-extension": "^2.1.4",
30-
"behatch/contexts": "^3.0",
25+
"friendsofphp/php-cs-fixer": "^2.15",
3126
"hautelook/alice-bundle": "^2.3",
27+
"justinrainbow/json-schema": "^5.2",
3228
"phpunit/php-code-coverage": "^7.0",
3329
"symfony/maker-bundle": "^1.11",
3430
"symfony/profiler-pack": "^1.0",
31+
"symfony/test-pack": "^1.0",
3532
"symfony/var-dumper": "4.3.*"
3633
},
3734
"config": {

0 commit comments

Comments
 (0)