Skip to content

Commit 5061e0c

Browse files
committed
updates adding tests in and updating readme/composer file
1 parent 3264c65 commit 5061e0c

6 files changed

Lines changed: 1140 additions & 24 deletions

File tree

.github/workflows/tests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
phpunit:
11+
name: PHPUnit (PHP ${{ matrix.php-version }})
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-version: ['8.0', '8.1', '8.2', '8.3']
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php-version }}
25+
extensions: soap
26+
coverage: xdebug
27+
tools: composer:v2
28+
29+
- name: Get Composer cache directory
30+
id: composer-cache
31+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
32+
33+
- name: Cache Composer dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: ${{ steps.composer-cache.outputs.dir }}
37+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-composer-
40+
41+
- name: Install dependencies
42+
run: composer install --prefer-dist --no-progress --no-interaction
43+
44+
- name: Run tests
45+
run: vendor/bin/phpunit
46+
47+
- name: Generate Coverage Report
48+
if: matrix.php-version == '8.2'
49+
run: |
50+
php -d xdebug.mode=coverage vendor/bin/phpunit \
51+
--coverage-clover coverage.xml \
52+
--coverage-text
53+
54+
- name: Upload Coverage to Codecov
55+
if: matrix.php-version == '8.2'
56+
uses: codecov/codecov-action@v4
57+
with:
58+
file: coverage.xml
59+
fail_ci_if_error: false
60+
env:
61+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
1-
# SSL Certificates Module for MyAdmin
1+
# MyAdmin SSL Certificates Module
22

3-
SSL Certificates Module for MyAdmin
3+
[![Tests](https://github.com/detain/myadmin-ssl-module/actions/workflows/tests.yml/badge.svg)](https://github.com/detain/myadmin-ssl-module/actions/workflows/tests.yml)
4+
[![License: LGPL-2.1](https://img.shields.io/badge/License-LGPL%202.1-blue.svg)](https://opensource.org/licenses/LGPL-2.1)
5+
[![Latest Stable Version](https://poser.pugx.org/detain/myadmin-ssl-module/version)](https://packagist.org/packages/detain/myadmin-ssl-module)
46

5-
## Build Status and Code Analysis
7+
SSL Certificates module for the [MyAdmin](https://github.com/detain/myadmin) control panel. Provides provisioning, activation, reactivation, and lifecycle management of SSL certificate services with automated admin notifications and billing integration.
68

7-
Site | Status
8-
--------------|---------------------------
9-
![Travis-CI](http://i.is.cc/storage/GYd75qN.png "Travis-CI") | [![Build Status](https://travis-ci.org/detain/myadmin-ssl-module.svg?branch=master)](https://travis-ci.org/detain/myadmin-ssl-module)
10-
![CodeClimate](http://i.is.cc/storage/GYlageh.png "CodeClimate") | [![Code Climate](https://codeclimate.com/github/detain/myadmin-ssl-module/badges/gpa.svg)](https://codeclimate.com/github/detain/myadmin-ssl-module) [![Test Coverage](https://codeclimate.com/github/detain/myadmin-ssl-module/badges/coverage.svg)](https://codeclimate.com/github/detain/myadmin-ssl-module/coverage) [![Issue Count](https://codeclimate.com/github/detain/myadmin-ssl-module/badges/issue_count.svg)](https://codeclimate.com/github/detain/myadmin-ssl-module)
11-
![Scrutinizer](http://i.is.cc/storage/GYeUnux.png "Scrutinizer") | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/myadmin-plugins/ssl-module/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/ssl-module/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/myadmin-plugins/ssl-module/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/ssl-module/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/myadmin-plugins/ssl-module/badges/build.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/ssl-module/build-status/master)
12-
![Codacy](http://i.is.cc/storage/GYi66Cx.png "Codacy") | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/226251fc068f4fd5b4b4ef9a40011d06)](https://www.codacy.com/app/detain/myadmin-ssl-module) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/25fa74eb74c947bf969602fcfe87e349)](https://www.codacy.com/app/detain/myadmin-ssl-module?utm_source=github.com&utm_medium=referral&utm_content=detain/myadmin-ssl-module&utm_campaign=Badge_Coverage)
13-
![Coveralls](http://i.is.cc/storage/GYjNSim.png "Coveralls") | [![Coverage Status](https://coveralls.io/repos/github/detain/db_abstraction/badge.svg?branch=master)](https://coveralls.io/github/detain/myadmin-ssl-module?branch=master)
14-
![Packagist](http://i.is.cc/storage/GYacBEX.png "Packagist") | [![Latest Stable Version](https://poser.pugx.org/detain/myadmin-ssl-module/version)](https://packagist.org/packages/detain/myadmin-ssl-module) [![Total Downloads](https://poser.pugx.org/detain/myadmin-ssl-module/downloads)](https://packagist.org/packages/detain/myadmin-ssl-module) [![Latest Unstable Version](https://poser.pugx.org/detain/myadmin-ssl-module/v/unstable)](//packagist.org/packages/detain/myadmin-ssl-module) [![Monthly Downloads](https://poser.pugx.org/detain/myadmin-ssl-module/d/monthly)](https://packagist.org/packages/detain/myadmin-ssl-module) [![Daily Downloads](https://poser.pugx.org/detain/myadmin-ssl-module/d/daily)](https://packagist.org/packages/detain/myadmin-ssl-module) [![License](https://poser.pugx.org/detain/myadmin-ssl-module/license)](https://packagist.org/packages/detain/myadmin-ssl-module)
9+
## Features
1510

11+
- Full service lifecycle support: enable, reactivate, disable
12+
- Automated admin email notifications for certificate creation and reactivation
13+
- Symfony EventDispatcher integration for hook-based architecture
14+
- Configurable billing, suspension, and deletion policies
15+
- Out-of-stock toggle for sales control
1616

17-
## Installation
17+
## Requirements
18+
19+
- PHP >= 5.0
20+
- ext-soap
21+
- Symfony EventDispatcher ^5.0
22+
- MyAdmin Plugin Installer
1823

19-
Install with composer like
24+
## Installation
2025

21-
```sh
26+
```bash
2227
composer require detain/myadmin-ssl-module
2328
```
2429

25-
## License
30+
## Testing
2631

27-
The SSL Certificates Module for MyAdmin class is licensed under the LGPL-v2.1 license.
32+
```bash
33+
composer install
34+
vendor/bin/phpunit
35+
```
36+
37+
## License
2838

39+
This package is licensed under the [LGPL-2.1](LICENSE).

composer.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,28 @@
1616
],
1717
"config": {
1818
"bin-dir": "vendor\/bin",
19-
"minimum-stability": "dev"
19+
"minimum-stability": "dev",
20+
"allow-plugins": {
21+
"detain/myadmin-plugin-installer": true
22+
}
2023
},
2124
"require": {
2225
"php": ">=5.0.0",
2326
"ext-soap": "*",
2427
"symfony/event-dispatcher": "^5.0@stable",
2528
"detain/myadmin-plugin-installer": "dev-master"
26-
},
29+
},
2730
"require-dev": {
28-
"phpunit/phpunit": "*",
29-
"phpunit/phpunit-mock-objects": "*",
30-
"vlucas/phpdotenv": "*",
31-
"codeclimate/php-test-reporter": "dev-master",
32-
"satooshi/php-coveralls": "*",
33-
"codacy/coverage": "dev-master"
31+
"phpunit/phpunit": "^9.6"
3432
},
3533
"autoload": {
3634
"psr-4": {
3735
"Detain\\MyAdminSsl\\": "src/"
3836
}
37+
},
38+
"autoload-dev": {
39+
"psr-4": {
40+
"Detain\\MyAdminSsl\\Tests\\": "tests/"
41+
}
3942
}
4043
}

phpunit.xml.dist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
4+
bootstrap="tests/bootstrap.php"
5+
cacheResultFile=".phpunit.cache/test-results"
6+
colors="true"
7+
executionOrder="depends,defects"
8+
forceCoversAnnotation="false"
9+
beStrictAboutCoversAnnotation="false"
10+
beStrictAboutOutputDuringTests="true"
11+
beStrictAboutTodoAnnotatedTests="true"
12+
failOnRisky="true"
13+
failOnWarning="true"
14+
verbose="true">
15+
<testsuites>
16+
<testsuite name="default">
17+
<directory suffix="Test.php">tests</directory>
18+
</testsuite>
19+
</testsuites>
20+
<coverage cacheDirectory=".phpunit.cache/code-coverage"
21+
processUncoveredFiles="true">
22+
<include>
23+
<directory suffix=".php">src</directory>
24+
</include>
25+
</coverage>
26+
</phpunit>

0 commit comments

Comments
 (0)