Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests #21

Merged
merged 9 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: unit-test

on: [push]

jobs:
build-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: php-actions/composer@v6

- name: PHPUnit Tests
uses: php-actions/phpunit@v3
with:
php_extensions: xdebug
bootstrap: tests/bootstrap.php
configuration: phpunit.xml
args: --coverage-text
env:
XDEBUG_MODE: coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

/vendor/
wappspector.phar
.phpunit.cache
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# wappspector
Command-line interface utility to analyze the file structure of a web hosting server and identify the frameworks and CMS used in the websites hosted on it.

[![unit-test](https://github.com/plesk/wappspector/actions/workflows/unit-test.yml/badge.svg)](https://github.com/plesk/wappspector/actions/workflows/unit-test.yml)

## Matchers
### Technology & Frameworks

Expand Down Expand Up @@ -56,3 +58,8 @@ or
$diContainer = \Plesk\Wappspector\DIContainer::build();
$diContainer->set('matchers', [\Plesk\Wappspector\WappMatchers\WordpressMatcher::class]);
```

## Testing
```shell
./vendor/bin/phpunit
```
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"bin/wappspector.php"
],
"scripts": {
"test": "phpunit",
"lint": "phpcs -s --parallel=4",
"lint:fix": "phpcbf"
},
Expand All @@ -16,10 +17,12 @@
},
"autoload": {
"psr-4": {
"Plesk\\Wappspector\\": "src/"
"Plesk\\Wappspector\\": "src/",
"Test\\": "tests/"
}
},
"require-dev": {
"phpunit/phpunit": "^10",
"psr/log": "^2.0",
"slevomat/coding-standard": "^8.8.0",
"squizlabs/php_codesniffer": "^3.7.2",
Expand All @@ -31,9 +34,6 @@
"php-di/php-di": "^6.0"
},
"config": {
"platform": {
"php": "8.0.28"
},
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
Expand Down
Loading