Skip to content

Commit a14ad50

Browse files
committed
add tests
1 parent 09d7269 commit a14ad50

File tree

8 files changed

+2304
-12
lines changed

8 files changed

+2304
-12
lines changed

.env.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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
6+
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,13 @@
1313
/public/assets/
1414
/assets/vendor/
1515
###< symfony/asset-mapper ###
16+
17+
###> symfony/phpunit-bridge ###
18+
.phpunit.result.cache
19+
/phpunit.xml
20+
###< symfony/phpunit-bridge ###
21+
22+
###> phpunit/phpunit ###
23+
/phpunit.xml
24+
.phpunit.result.cache
25+
###< phpunit/phpunit ###

bin/phpunit

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
if (!ini_get('date.timezone')) {
5+
ini_set('date.timezone', 'UTC');
6+
}
7+
8+
if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
9+
if (PHP_VERSION_ID >= 80000) {
10+
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
11+
} else {
12+
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
13+
require PHPUNIT_COMPOSER_INSTALL;
14+
PHPUnit\TextUI\Command::main();
15+
}
16+
} else {
17+
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
18+
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
19+
exit(1);
20+
}
21+
22+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
23+
}

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@
3030
"twig/twig": "^3.0"
3131
},
3232
"require-dev": {
33+
"phpunit/phpunit": "^9.5",
34+
"symfony/browser-kit": "7.2.*",
35+
"symfony/css-selector": "7.2.*",
3336
"symfony/debug-bundle": "7.2.*",
3437
"symfony/maker-bundle": "^1.61",
38+
"symfony/phpunit-bridge": "^7.1",
3539
"symfony/stopwatch": "7.2.*",
3640
"symfony/web-profiler-bundle": "7.2.*",
41+
"zenstruck/browser": "^1.9",
3742
"zenstruck/foundry": "^2.2"
3843
},
3944
"config": {

0 commit comments

Comments
 (0)