Skip to content

Commit 6d3b92f

Browse files
committed
updates adding tests in and updating readme/composer file
1 parent 1a01ba4 commit 6d3b92f

5 files changed

Lines changed: 986 additions & 26 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, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php: ['8.2', '8.3', '8.4']
16+
17+
name: PHP ${{ matrix.php }}
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 }}
27+
extensions: soap
28+
coverage: none
29+
30+
- name: Install dependencies
31+
run: composer install --prefer-dist --no-interaction --no-progress
32+
33+
- name: Run tests
34+
run: vendor/bin/phpunit --colors=always

README.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
1-
# Hyperv Vps Class
1+
# MyAdmin Hyper-V VPS Plugin
22

3-
Hyperv Vps Class
3+
[![Tests](https://github.com/detain/myadmin-hyperv-vps/actions/workflows/tests.yml/badge.svg)](https://github.com/detain/myadmin-hyperv-vps/actions/workflows/tests.yml)
4+
[![Latest Stable Version](https://poser.pugx.org/detain/myadmin-hyperv-vps/version)](https://packagist.org/packages/detain/myadmin-hyperv-vps)
5+
[![Total Downloads](https://poser.pugx.org/detain/myadmin-hyperv-vps/downloads)](https://packagist.org/packages/detain/myadmin-hyperv-vps)
6+
[![License](https://poser.pugx.org/detain/myadmin-hyperv-vps/license)](https://packagist.org/packages/detain/myadmin-hyperv-vps)
47

5-
## Build Status and Code Analysis
8+
A MyAdmin plugin for managing Microsoft Hyper-V virtual private servers. This package provides full lifecycle management of Hyper-V VPS instances including provisioning, configuration, power control, disk resizing, IOPS management, and teardown through a SOAP-based API integration.
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-hyperv-vps.svg?branch=master)](https://travis-ci.org/detain/myadmin-hyperv-vps)
10-
![CodeClimate](http://i.is.cc/storage/GYlageh.png "CodeClimate") | [![Code Climate](https://codeclimate.com/github/detain/myadmin-hyperv-vps/badges/gpa.svg)](https://codeclimate.com/github/detain/myadmin-hyperv-vps) [![Test Coverage](https://codeclimate.com/github/detain/myadmin-hyperv-vps/badges/coverage.svg)](https://codeclimate.com/github/detain/myadmin-hyperv-vps/coverage) [![Issue Count](https://codeclimate.com/github/detain/myadmin-hyperv-vps/badges/issue_count.svg)](https://codeclimate.com/github/detain/myadmin-hyperv-vps)
11-
![Scrutinizer](http://i.is.cc/storage/GYeUnux.png "Scrutinizer") | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/myadmin-plugins/hyperv-vps/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/hyperv-vps/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/myadmin-plugins/hyperv-vps/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/hyperv-vps/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/myadmin-plugins/hyperv-vps/badges/build.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/hyperv-vps/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-hyperv-vps) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/25fa74eb74c947bf969602fcfe87e349)](https://www.codacy.com/app/detain/myadmin-hyperv-vps?utm_source=github.com&utm_medium=referral&utm_content=detain/myadmin-hyperv-vps&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-hyperv-vps?branch=master)
14-
![Packagist](http://i.is.cc/storage/GYacBEX.png "Packagist") | [![Latest Stable Version](https://poser.pugx.org/detain/myadmin-hyperv-vps/version)](https://packagist.org/packages/detain/myadmin-hyperv-vps) [![Total Downloads](https://poser.pugx.org/detain/myadmin-hyperv-vps/downloads)](https://packagist.org/packages/detain/myadmin-hyperv-vps) [![Latest Unstable Version](https://poser.pugx.org/detain/myadmin-hyperv-vps/v/unstable)](//packagist.org/packages/detain/myadmin-hyperv-vps) [![Monthly Downloads](https://poser.pugx.org/detain/myadmin-hyperv-vps/d/monthly)](https://packagist.org/packages/detain/myadmin-hyperv-vps) [![Daily Downloads](https://poser.pugx.org/detain/myadmin-hyperv-vps/d/daily)](https://packagist.org/packages/detain/myadmin-hyperv-vps) [![License](https://poser.pugx.org/detain/myadmin-hyperv-vps/license)](https://packagist.org/packages/detain/myadmin-hyperv-vps)
10+
## Features
1511

12+
- Virtual machine creation with configurable RAM, disk, and OS template
13+
- Power management (start, stop, reboot, pause, resume)
14+
- Dynamic CPU and memory resizing via slice-based allocation
15+
- IOPS rate limiting with configurable min/max thresholds
16+
- Automated IP assignment and network configuration
17+
- Administrator password management
18+
- Event-driven architecture using Symfony EventDispatcher
19+
- Queue-based operation sequencing for multi-step workflows
1620

1721
## Installation
1822

19-
Install with composer like
20-
2123
```sh
2224
composer require detain/myadmin-hyperv-vps
2325
```
2426

25-
## License
27+
## Requirements
28+
29+
- PHP >= 5.0
30+
- ext-soap
31+
- Symfony EventDispatcher ^5.0
32+
33+
## Running Tests
2634

27-
The Hyperv Vps Class class is licensed under the LGPL-v2.1 license.
35+
```sh
36+
composer install
37+
vendor/bin/phpunit
38+
```
39+
40+
## License
2841

42+
This package is licensed under the [LGPL-2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) license.

composer.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
{
22
"name": "detain/myadmin-hyperv-vps",
33
"type": "myadmin-plugin",
4-
"description": "Hyperv Vps Class",
4+
"description": "MyAdmin HyperV VPS plugin providing integration with Microsoft Hyper-V for virtual machine provisioning, management, and lifecycle operations including create, delete, resize, and IOPS configuration via SOAP-based API.",
55
"keywords": [
66
"hyperv",
7+
"hyper-v",
8+
"vps",
9+
"virtualization",
710
"administration",
8-
"license"
11+
"myadmin",
12+
"plugin"
913
],
1014
"license": "LGPL-2.1-only",
1115
"authors": [
1216
{
1317
"name": "Joe Huss",
14-
"homepage": "https:\/\/my.interserver.net\/"
18+
"homepage": "https://my.interserver.net/"
1519
}
1620
],
1721
"config": {
18-
"bin-dir": "vendor\/bin",
22+
"bin-dir": "vendor/bin",
1923
"minimum-stability": "dev"
2024
},
2125
"require": {
2226
"php": ">=5.0.0",
2327
"ext-soap": "*",
2428
"symfony/event-dispatcher": "^5.0@stable",
2529
"detain/myadmin-plugin-installer": "dev-master"
26-
},
30+
},
2731
"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"
32+
"phpunit/phpunit": "^9.6"
3433
},
3534
"autoload": {
3635
"psr-4": {
3736
"Detain\\MyAdminHyperv\\": "src/"
3837
}
38+
},
39+
"autoload-dev": {
40+
"psr-4": {
41+
"Detain\\MyAdminHyperv\\Tests\\": "tests/"
42+
}
3943
}
4044
}

phpunit.xml.dist

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
bootstrap="vendor/autoload.php"
6+
colors="true"
7+
verbose="true"
8+
failOnRisky="true"
9+
failOnWarning="true"
10+
beStrictAboutOutputDuringTests="true"
11+
>
12+
<testsuites>
13+
<testsuite name="Unit">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
18+
<coverage processUncoveredFiles="true">
19+
<include>
20+
<directory suffix=".php">src</directory>
21+
</include>
22+
</coverage>
23+
</phpunit>

0 commit comments

Comments
 (0)