Skip to content

Commit e723152

Browse files
author
alutskevich
committed
Step 3: add validation, create service, dto, entity, repository etc and install phpunit
1 parent c41d949 commit e723152

18 files changed

+2784
-63
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
@@ -9,3 +9,13 @@
99
/var/
1010
/vendor/
1111
###< symfony/framework-bundle ###
12+
13+
###> phpunit/phpunit ###
14+
/phpunit.xml
15+
.phpunit.result.cache
16+
###< phpunit/phpunit ###
17+
18+
###> symfony/phpunit-bridge ###
19+
.phpunit.result.cache
20+
/phpunit.xml
21+
###< symfony/phpunit-bridge ###

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Requirements:
2-
- php >= 8.0.2
2+
- php 8.1
33

44
# Setup
55
1. Run `php composer.phar install`

bin/phpunit

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
10+
require PHPUNIT_COMPOSER_INSTALL;
11+
PHPUnit\TextUI\Command::main();
12+
} else {
13+
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
14+
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
15+
exit(1);
16+
}
17+
18+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
19+
}

composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
],
5656
"post-update-cmd": [
5757
"@auto-scripts"
58+
],
59+
"tests": [
60+
"phpunit"
5861
]
5962
},
6063
"conflict": {
@@ -65,5 +68,9 @@
6568
"allow-contrib": false,
6669
"require": "6.0.*"
6770
}
71+
},
72+
"require-dev": {
73+
"phpunit/phpunit": "^9",
74+
"symfony/phpunit-bridge": "^6.0"
6875
}
6976
}

0 commit comments

Comments
 (0)