Skip to content

Commit 93564af

Browse files
committed
✅ Add tests
1 parent f8aaf14 commit 93564af

File tree

6 files changed

+641
-0
lines changed

6 files changed

+641
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
.idea/
2+
vendor/
3+
build/
4+
composer.lock
5+
.phpunit.result.cache

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,14 @@ public function boot()
497497

498498
Further information on how to set up event listeners can be found on the [official docs](https://laravel.com/docs/events).
499499

500+
## Testing
501+
502+
Run the tests with:
503+
504+
```bash
505+
composer test
506+
```
507+
500508
## TODO List
501509

502510
- Write unit tests

composer.json

+11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"ext-json": "*"
1010
},
1111
"require-dev": {
12+
"phpunit/phpunit": "^9.5.4",
13+
"orchestra/testbench": "^6.0",
14+
"nunomaduro/collision": "^5.3",
1215
"roave/security-advisories": "dev-latest"
1316
},
1417
"license": "MIT",
@@ -18,11 +21,19 @@
1821
"email": "[email protected]"
1922
}
2023
],
24+
"scripts": {
25+
"test": "./vendor/bin/testbench package:test"
26+
},
2127
"autoload": {
2228
"psr-4": {
2329
"MarcReichel\\IGDBLaravel\\": "src"
2430
}
2531
},
32+
"autoload-dev": {
33+
"psr-4": {
34+
"MarcReichel\\IGDBLaravel\\Tests\\": "tests"
35+
}
36+
},
2637
"extra": {
2738
"laravel": {
2839
"providers": [

phpunit.xml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
backupGlobals="false"
6+
backupStaticAttributes="false"
7+
bootstrap="vendor/autoload.php"
8+
colors="true"
9+
convertErrorsToExceptions="true"
10+
convertNoticesToExceptions="true"
11+
convertWarningsToExceptions="true"
12+
processIsolation="false"
13+
stopOnFailure="false"
14+
executionOrder="random"
15+
failOnWarning="true"
16+
failOnRisky="true"
17+
failOnEmptyTestSuite="true"
18+
beStrictAboutOutputDuringTests="true"
19+
verbose="true"
20+
>
21+
<testsuites>
22+
<testsuite name="IGDBLaravel Test Suite">
23+
<directory>tests</directory>
24+
</testsuite>
25+
</testsuites>
26+
<coverage>
27+
<include>
28+
<directory suffix=".php">./src</directory>
29+
</include>
30+
<report>
31+
<html outputDirectory="build/coverage"/>
32+
<text outputFile="build/coverage.txt"/>
33+
<clover outputFile="build/logs/clover.xml"/>
34+
</report>
35+
</coverage>
36+
<logging>
37+
<junit outputFile="build/report.junit.xml"/>
38+
</logging>
39+
</phpunit>

0 commit comments

Comments
 (0)