Skip to content

Commit f2afbe6

Browse files
feat: add unit tests for Price Twig component
1 parent c81c7a2 commit f2afbe6

9 files changed

+1982
-3
lines changed

.env.test

+6
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

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
###> symfony/framework-bundle ###
32
/.env.local
43
/.env.local.php
@@ -13,3 +12,12 @@
1312
/public/assets/
1413
/assets/vendor/
1514
###< symfony/asset-mapper ###
15+
###> phpunit/phpunit ###
16+
/phpunit.xml
17+
.phpunit.result.cache
18+
###< phpunit/phpunit ###
19+
20+
###> symfony/phpunit-bridge ###
21+
.phpunit.result.cache
22+
/phpunit.xml
23+
###< symfony/phpunit-bridge ###

bin/phpunit

+23
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

+4
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,9 @@
7373
"require": "7.1.*",
7474
"docker": true
7575
}
76+
},
77+
"require-dev": {
78+
"phpunit/phpunit": "^9.5",
79+
"symfony/phpunit-bridge": "^7.1"
7680
}
7781
}

0 commit comments

Comments
 (0)