Skip to content

Commit 10a0446

Browse files
committed
- writing unit tests
- writing integration tests - writing functional tests - introducing refresh tokens fixtures - updating docs - code refactoring & removing typos
1 parent c87e979 commit 10a0446

26 files changed

+1634
-82
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@
2424

2525
###> Uploads ###
2626
/public/media/
27-
###< Uploads ###
27+
###< Uploads ###
28+
###> symfony/phpunit-bridge ###
29+
.phpunit
30+
.phpunit.result.cache
31+
/phpunit.xml
32+
###< symfony/phpunit-bridge ###

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,20 @@ To install and run this app follow these instructions :
8585
API documentation is now available under `http://localhost:8000/api/docs` , enjoy :)
8686

8787
### Testing
88+
**Behat**
8889
- copy the file `behat.xml.dist` to `behat.xml`
8990
- Update your `.env.test` file according to your preferences
9091
- prepare testing environment by running ```$ composer prepare-test```
91-
- run tests ```$ vendor/bin/behat```
92+
- run tests ```$ vendor/bin/behat```
93+
94+
**Phpunit**
95+
- prepare testing environment by running ```$ composer prepare-test```
96+
- To run a specific suite
97+
98+
$ bin/phpunit --testsuite unit
99+
$ bin/phpunit --testsuite integration
100+
$ bin/phpunit --testsuite functional
101+
102+
- To run all tests with coverage
103+
104+
$ bin/phpunit --coverage-html ./build

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';

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"require": {
55
"php": ">=7.4",
66
"ext-ctype": "*",
7+
"ext-curl": "*",
78
"ext-iconv": "*",
89
"api-platform/core": "^2.5",
910
"composer/package-versions-deprecated": "^1.11",
@@ -13,6 +14,7 @@
1314
"doctrine/orm": "^2.7",
1415
"friends-of-behat/mink-browserkit-driver": "^1.4",
1516
"gesdinet/jwt-refresh-token-bundle": "^0.9.1",
17+
"justinrainbow/json-schema": "^5.2",
1618
"lexik/jwt-authentication-bundle": "^2.8",
1719
"nelmio/cors-bundle": "^2.1",
1820
"phpdocumentor/reflection-docblock": "^5.2",
@@ -31,7 +33,8 @@
3133
"symfony/twig-bundle": "5.1.*",
3234
"symfony/validator": "5.1.*",
3335
"symfony/yaml": "5.1.*",
34-
"vich/uploader-bundle": "^1.15"
36+
"vich/uploader-bundle": "^1.15",
37+
"ext-json": "*"
3538
},
3639
"require-dev": {
3740
"behat/behat": "^3.7",
@@ -40,7 +43,10 @@
4043
"doctrine/doctrine-fixtures-bundle": "^3.3",
4144
"friends-of-behat/symfony-extension": "^2.0",
4245
"fzaninotto/faker": "^1.9",
43-
"symfony/maker-bundle": "^1.21"
46+
"symfony/browser-kit": "5.1.*",
47+
"symfony/http-client": "5.1.*",
48+
"symfony/maker-bundle": "^1.21",
49+
"symfony/phpunit-bridge": "^5.1"
4450
},
4551
"config": {
4652
"optimize-autoloader": true,

0 commit comments

Comments
 (0)