Skip to content

Commit ed03691

Browse files
committed
updates adding tests in and updating readme/composer file
1 parent 4354202 commit ed03691

7 files changed

Lines changed: 1088 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: xdebug
29+
30+
- name: Install dependencies
31+
run: composer install --prefer-dist --no-progress
32+
33+
- name: Run tests
34+
run: vendor/bin/phpunit --colors=always

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ vendor/
33
.bettercodehub.yml
44
.idea/workspace.xml
55
.idea/libraries
6+
.phpunit.result.cache

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
11
# Dedicated Servers Module for MyAdmin
22

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

5-
## Build Status and Code Analysis
8+
A MyAdmin plugin module that provides dedicated server management capabilities. It integrates with the MyAdmin service lifecycle to handle server provisioning, activation, reactivation, deactivation, and suspension through the Symfony EventDispatcher system.
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-servers-module.svg?branch=master)](https://travis-ci.org/detain/myadmin-servers-module)
10-
![CodeClimate](http://i.is.cc/storage/GYlageh.png "CodeClimate") | [![Code Climate](https://codeclimate.com/github/detain/myadmin-servers-module/badges/gpa.svg)](https://codeclimate.com/github/detain/myadmin-servers-module) [![Test Coverage](https://codeclimate.com/github/detain/myadmin-servers-module/badges/coverage.svg)](https://codeclimate.com/github/detain/myadmin-servers-module/coverage) [![Issue Count](https://codeclimate.com/github/detain/myadmin-servers-module/badges/issue_count.svg)](https://codeclimate.com/github/detain/myadmin-servers-module)
11-
![Scrutinizer](http://i.is.cc/storage/GYeUnux.png "Scrutinizer") | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/myadmin-plugins/servers-module/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/servers-module/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/myadmin-plugins/servers-module/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/servers-module/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/myadmin-plugins/servers-module/badges/build.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/servers-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-servers-module) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/25fa74eb74c947bf969602fcfe87e349)](https://www.codacy.com/app/detain/myadmin-servers-module?utm_source=github.com&utm_medium=referral&utm_content=detain/myadmin-servers-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-servers-module?branch=master)
14-
![Packagist](http://i.is.cc/storage/GYacBEX.png "Packagist") | [![Latest Stable Version](https://poser.pugx.org/detain/myadmin-servers-module/version)](https://packagist.org/packages/detain/myadmin-servers-module) [![Total Downloads](https://poser.pugx.org/detain/myadmin-servers-module/downloads)](https://packagist.org/packages/detain/myadmin-servers-module) [![Latest Unstable Version](https://poser.pugx.org/detain/myadmin-servers-module/v/unstable)](//packagist.org/packages/detain/myadmin-servers-module) [![Monthly Downloads](https://poser.pugx.org/detain/myadmin-servers-module/d/monthly)](https://packagist.org/packages/detain/myadmin-servers-module) [![Daily Downloads](https://poser.pugx.org/detain/myadmin-servers-module/d/daily)](https://packagist.org/packages/detain/myadmin-servers-module) [![License](https://poser.pugx.org/detain/myadmin-servers-module/license)](https://packagist.org/packages/detain/myadmin-servers-module)
10+
## Features
1511

12+
- Dedicated server service lifecycle management (activate, deactivate, enable, reactivate, disable, terminate)
13+
- Configurable billing with prorate support and customizable day offsets
14+
- Automated email notifications for server reactivation events and pending setup alerts
15+
- Admin settings panel with out-of-stock toggle for controlling server sales
16+
- Event-driven architecture using Symfony EventDispatcher hooks
17+
- Server status management with suspended and active-billing states
1618

1719
## Installation
1820

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

2123
```sh
2224
composer require detain/myadmin-servers-module
2325
```
2426

25-
## License
27+
## Configuration
28+
29+
The module provides configurable settings through the `Plugin::$settings` array including service ID offsets, billing parameters, suspension thresholds, and database table mappings.
30+
31+
## Testing
32+
33+
Run the test suite with PHPUnit:
2634

27-
The Dedicated Servers Module for MyAdmin class is licensed under the LGPL-v2.1 license.
35+
```sh
36+
composer install
37+
vendor/bin/phpunit
38+
```
39+
40+
## License
2841

42+
The Dedicated Servers Module for MyAdmin is licensed under the LGPL-v2.1 license.

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
"ext-soap": "*",
2424
"symfony/event-dispatcher": "^5.0@stable",
2525
"detain/myadmin-plugin-installer": "dev-master"
26-
},
26+
},
2727
"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"
28+
"phpunit/phpunit": "^9.6"
3429
},
3530
"autoload": {
3631
"psr-4": {
3732
"Detain\\MyAdminServers\\": "src/"
3833
}
34+
},
35+
"autoload-dev": {
36+
"psr-4": {
37+
"Detain\\MyAdminServers\\Tests\\": "tests/"
38+
}
3939
}
4040
}

phpunit.xml.dist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="tests/bootstrap.php"
5+
colors="true"
6+
verbose="true"
7+
failOnRisky="true"
8+
failOnWarning="true"
9+
beStrictAboutOutputDuringTests="true"
10+
beStrictAboutTestsThatDoNotTestAnything="true">
11+
<testsuites>
12+
<testsuite name="default">
13+
<directory>tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
<coverage>
17+
<include>
18+
<directory suffix=".php">src</directory>
19+
</include>
20+
</coverage>
21+
</phpunit>

0 commit comments

Comments
 (0)