Skip to content

Commit b713ae7

Browse files
test coverage
1 parent 8f30c25 commit b713ae7

File tree

3 files changed

+29
-13
lines changed

3 files changed

+29
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/public/build
44
/public/hot
55
/public/storage
6+
/public/coverage
67
/storage/*.key
78
/vendor
89
.env

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ Vui lòng chạy lệnh dưới đây trước khi gửi Pull Request!
2626
composer ide
2727
php artisan test
2828
```
29+
30+
## Test Coverage
31+
32+
```bash
33+
php artisan test --coverage
34+
```
35+
36+
Mở trình duyệt http://127.0.0.1:8000/coverage/index.html để xem kết quả

phpunit.xml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
66
>
77
<testsuites>
88
<testsuite name="Unit">
@@ -17,17 +17,24 @@
1717
<directory>app</directory>
1818
</include>
1919
</source>
20+
<coverage>
21+
<report>
22+
<html outputDirectory="public/coverage" />
23+
<text outputFile="public/coverage/coverage.txt" />
24+
<clover outputFile="public/coverage/clover.xml" />
25+
</report>
26+
</coverage>
2027
<php>
21-
<env name="APP_ENV" value="testing"/>
22-
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
23-
<env name="BCRYPT_ROUNDS" value="4"/>
24-
<env name="CACHE_STORE" value="array"/>
28+
<env name="APP_ENV" value="testing" />
29+
<env name="APP_MAINTENANCE_DRIVER" value="file" />
30+
<env name="BCRYPT_ROUNDS" value="4" />
31+
<env name="CACHE_STORE" value="array" />
2532
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
2633
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
27-
<env name="MAIL_MAILER" value="array"/>
28-
<env name="PULSE_ENABLED" value="false"/>
29-
<env name="QUEUE_CONNECTION" value="sync"/>
30-
<env name="SESSION_DRIVER" value="array"/>
31-
<env name="TELESCOPE_ENABLED" value="false"/>
34+
<env name="MAIL_MAILER" value="array" />
35+
<env name="PULSE_ENABLED" value="false" />
36+
<env name="QUEUE_CONNECTION" value="sync" />
37+
<env name="SESSION_DRIVER" value="array" />
38+
<env name="TELESCOPE_ENABLED" value="false" />
3239
</php>
33-
</phpunit>
40+
</phpunit>

0 commit comments

Comments
 (0)