Skip to content

Commit aadca05

Browse files
committed
updates adding tests in and updating readme/composer file
1 parent 6717ceb commit aadca05

5 files changed

Lines changed: 763 additions & 20 deletions

File tree

.github/workflows/tests.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
php-version: ['8.2', '8.3', '8.4']
16+
17+
name: PHP ${{ matrix.php-version }}
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-version }}
27+
extensions: soap
28+
coverage: none
29+
30+
- name: Install dependencies
31+
run: composer install --no-interaction --prefer-dist
32+
33+
- name: Run tests
34+
run: vendor/bin/phpunit

README.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,52 @@
11
# Dedicated IP Addon for Webhosting Module in MyAdmin
22

3-
Dedicated IP Addon for Webhosting Module in MyAdmin
3+
[![Tests](https://github.com/detain/myadmin-ip-webhosting-addon/actions/workflows/tests.yml/badge.svg)](https://github.com/detain/myadmin-ip-webhosting-addon/actions/workflows/tests.yml)
4+
[![Latest Stable Version](https://poser.pugx.org/detain/myadmin-ip-webhosting-addon/version)](https://packagist.org/packages/detain/myadmin-ip-webhosting-addon)
5+
[![Total Downloads](https://poser.pugx.org/detain/myadmin-ip-webhosting-addon/downloads)](https://packagist.org/packages/detain/myadmin-ip-webhosting-addon)
6+
[![License](https://poser.pugx.org/detain/myadmin-ip-webhosting-addon/license)](https://packagist.org/packages/detain/myadmin-ip-webhosting-addon)
47

5-
## Build Status and Code Analysis
8+
A MyAdmin plugin addon that provides dedicated IP address management for the webhosting module. This package enables the purchase, assignment, and revocation of dedicated IP addresses on cPanel/WHM-based webhosting servers through the MyAdmin service management platform.
69

7-
Site | Status
8-
--------------|---------------------------
9-
![Travis-CI](http://i.is.cc/storage/GYd75qN.png "Travis-CI") | [![Build Status](https://travis-ci.org/detain/myadmin-ip-webhosting-addon.svg?branch=master)](https://travis-ci.org/detain/myadmin-ip-webhosting-addon)
10-
![CodeClimate](http://i.is.cc/storage/GYlageh.png "CodeClimate") | [![Code Climate](https://codeclimate.com/github/detain/myadmin-ip-webhosting-addon/badges/gpa.svg)](https://codeclimate.com/github/detain/myadmin-ip-webhosting-addon) [![Test Coverage](https://codeclimate.com/github/detain/myadmin-ip-webhosting-addon/badges/coverage.svg)](https://codeclimate.com/github/detain/myadmin-ip-webhosting-addon/coverage) [![Issue Count](https://codeclimate.com/github/detain/myadmin-ip-webhosting-addon/badges/issue_count.svg)](https://codeclimate.com/github/detain/myadmin-ip-webhosting-addon)
11-
![Scrutinizer](http://i.is.cc/storage/GYeUnux.png "Scrutinizer") | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/myadmin-plugins/ip-webhosting-addon/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/ip-webhosting-addon/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/myadmin-plugins/ip-webhosting-addon/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/ip-webhosting-addon/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/myadmin-plugins/ip-webhosting-addon/badges/build.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/ip-webhosting-addon/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-ip-webhosting-addon) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/25fa74eb74c947bf969602fcfe87e349)](https://www.codacy.com/app/detain/myadmin-ip-webhosting-addon?utm_source=github.com&utm_medium=referral&utm_content=detain/myadmin-ip-webhosting-addon&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-ip-webhosting-addon?branch=master)
14-
![Packagist](http://i.is.cc/storage/GYacBEX.png "Packagist") | [![Latest Stable Version](https://poser.pugx.org/detain/myadmin-ip-webhosting-addon/version)](https://packagist.org/packages/detain/myadmin-ip-webhosting-addon) [![Total Downloads](https://poser.pugx.org/detain/myadmin-ip-webhosting-addon/downloads)](https://packagist.org/packages/detain/myadmin-ip-webhosting-addon) [![Latest Unstable Version](https://poser.pugx.org/detain/myadmin-ip-webhosting-addon/v/unstable)](//packagist.org/packages/detain/myadmin-ip-webhosting-addon) [![Monthly Downloads](https://poser.pugx.org/detain/myadmin-ip-webhosting-addon/d/monthly)](https://packagist.org/packages/detain/myadmin-ip-webhosting-addon) [![Daily Downloads](https://poser.pugx.org/detain/myadmin-ip-webhosting-addon/d/daily)](https://packagist.org/packages/detain/myadmin-ip-webhosting-addon) [![License](https://poser.pugx.org/detain/myadmin-ip-webhosting-addon/license)](https://packagist.org/packages/detain/myadmin-ip-webhosting-addon)
10+
## Features
1511

12+
- Sells dedicated IP addresses as an addon for webhosting services
13+
- Automatically assigns available IPs from the WHM server pool when enabled
14+
- Reverts to shared IP when the addon is disabled or canceled
15+
- Sends administrative email notifications for IP assignment events and errors
16+
- Integrates with the MyAdmin settings system for configurable IP pricing
17+
- Supports Symfony EventDispatcher hooks for seamless plugin integration
1618

1719
## Installation
1820

19-
Install with composer like
21+
Install via Composer:
2022

2123
```sh
2224
composer require detain/myadmin-ip-webhosting-addon
2325
```
2426

25-
## License
27+
## Requirements
28+
29+
- PHP >= 5.0
30+
- ext-soap
31+
- symfony/event-dispatcher ^5.0
32+
- detain/myadmin-plugin-installer
33+
34+
## Usage
35+
36+
The plugin registers itself through the MyAdmin plugin system using Symfony EventDispatcher hooks. Once installed, it automatically integrates with the webhosting module to provide dedicated IP addon functionality.
37+
38+
The plugin registers two event hooks:
39+
40+
- `webhosting.load_addons` -- registers the dedicated IP addon with the service handler
41+
- `webhosting.settings` -- adds the IP cost configuration to the module settings
2642

27-
The Dedicated IP Addon for Webhosting Module in MyAdmin class is licensed under the LGPL-v2.1 license.
43+
## Testing
44+
45+
```sh
46+
composer install
47+
vendor/bin/phpunit
48+
```
49+
50+
## License
2851

52+
This package is licensed under the [LGPL-2.1-only](https://opensource.org/licenses/LGPL-2.1) license.

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,9 @@
2727
"ext-soap": "*",
2828
"symfony/event-dispatcher": "^5.0@stable",
2929
"detain/myadmin-plugin-installer": "dev-master"
30-
},
30+
},
3131
"require-dev": {
32-
"phpunit/phpunit": "*",
33-
"phpunit/phpunit-mock-objects": "*",
34-
"vlucas/phpdotenv": "*",
35-
"codeclimate/php-test-reporter": "dev-master",
36-
"satooshi/php-coveralls": "*",
37-
"codacy/coverage": "dev-master"
32+
"phpunit/phpunit": "^9.6"
3833
},
3934
"repositories": [
4035
{
@@ -54,5 +49,10 @@
5449
"psr-4": {
5550
"Detain\\MyAdminWebhostingIp\\": "src/"
5651
}
52+
},
53+
"autoload-dev": {
54+
"psr-4": {
55+
"Detain\\MyAdminWebhostingIp\\Tests\\": "tests/"
56+
}
5757
}
5858
}

phpunit.xml.dist

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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"
6+
verbose="true"
7+
failOnRisky="true"
8+
failOnWarning="true"
9+
beStrictAboutTestsThatDoNotTestAnything="true">
10+
<testsuites>
11+
<testsuite name="Unit">
12+
<directory>tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
<coverage processUncoveredFiles="true">
16+
<include>
17+
<directory suffix=".php">src</directory>
18+
</include>
19+
</coverage>
20+
</phpunit>

0 commit comments

Comments
 (0)