Skip to content

Commit 3b96db4

Browse files
committed
updates adding tests in and updating readme/composer file
1 parent b489243 commit 3b96db4

6 files changed

Lines changed: 1639 additions & 121 deletions

File tree

.github/workflows/tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
fail-fast: false
15+
matrix:
16+
php: ['8.2', '8.3', '8.4']
17+
18+
name: PHP ${{ matrix.php }}
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
extensions: curl, mbstring, soap
29+
coverage: none
30+
31+
- name: Install dependencies
32+
run: composer install --prefer-dist --no-interaction --no-progress
33+
34+
- name: Run tests
35+
run: vendor/bin/phpunit --no-coverage

README.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
1-
# VestaCP Webhosting Class
1+
# VestaCP Webhosting Plugin
22

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

5-
## Build Status and Code Analysis
8+
A MyAdmin plugin that provides VestaCP webhosting integration. This package supplies a PHP API client for the VestaCP control panel and an event-driven plugin that handles the full hosting account lifecycle -- activation, reactivation, suspension, and termination -- through the Symfony EventDispatcher.
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-vestacp-webhosting.svg?branch=master)](https://travis-ci.org/detain/myadmin-vestacp-webhosting)
10-
![CodeClimate](http://i.is.cc/storage/GYlageh.png "CodeClimate") | [![Code Climate](https://codeclimate.com/github/detain/myadmin-vestacp-webhosting/badges/gpa.svg)](https://codeclimate.com/github/detain/myadmin-vestacp-webhosting) [![Test Coverage](https://codeclimate.com/github/detain/myadmin-vestacp-webhosting/badges/coverage.svg)](https://codeclimate.com/github/detain/myadmin-vestacp-webhosting/coverage) [![Issue Count](https://codeclimate.com/github/detain/myadmin-vestacp-webhosting/badges/issue_count.svg)](https://codeclimate.com/github/detain/myadmin-vestacp-webhosting)
11-
![Scrutinizer](http://i.is.cc/storage/GYeUnux.png "Scrutinizer") | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/myadmin-plugins/vestacp-webhosting/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/vestacp-webhosting/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/myadmin-plugins/vestacp-webhosting/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/vestacp-webhosting/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/myadmin-plugins/vestacp-webhosting/badges/build.png?b=master)](https://scrutinizer-ci.com/g/myadmin-plugins/vestacp-webhosting/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-vestacp-webhosting) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/25fa74eb74c947bf969602fcfe87e349)](https://www.codacy.com/app/detain/myadmin-vestacp-webhosting?utm_source=github.com&utm_medium=referral&utm_content=detain/myadmin-vestacp-webhosting&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-vestacp-webhosting?branch=master)
14-
![Packagist](http://i.is.cc/storage/GYacBEX.png "Packagist") | [![Latest Stable Version](https://poser.pugx.org/detain/myadmin-vestacp-webhosting/version)](https://packagist.org/packages/detain/myadmin-vestacp-webhosting) [![Total Downloads](https://poser.pugx.org/detain/myadmin-vestacp-webhosting/downloads)](https://packagist.org/packages/detain/myadmin-vestacp-webhosting) [![Latest Unstable Version](https://poser.pugx.org/detain/myadmin-vestacp-webhosting/v/unstable)](//packagist.org/packages/detain/myadmin-vestacp-webhosting) [![Monthly Downloads](https://poser.pugx.org/detain/myadmin-vestacp-webhosting/d/monthly)](https://packagist.org/packages/detain/myadmin-vestacp-webhosting) [![Daily Downloads](https://poser.pugx.org/detain/myadmin-vestacp-webhosting/d/daily)](https://packagist.org/packages/detain/myadmin-vestacp-webhosting) [![License](https://poser.pugx.org/detain/myadmin-vestacp-webhosting/license)](https://packagist.org/packages/detain/myadmin-vestacp-webhosting)
10+
## Features
1511

12+
- VestaCP API client with support for account creation, suspension, deletion, domain and database management, and credential verification
13+
- Event-driven plugin architecture using Symfony EventDispatcher hooks
14+
- Full hosting lifecycle management (activate, reactivate, deactivate, terminate)
15+
- Administrative settings and menu integration for the MyAdmin control panel
16+
17+
## Requirements
18+
19+
- PHP >= 5.0
20+
- ext-curl
21+
- ext-soap
22+
- ext-mbstring
23+
- Symfony EventDispatcher ^5.0
1624

1725
## Installation
1826

19-
Install with composer like
27+
Install with Composer:
2028

2129
```sh
2230
composer require detain/myadmin-vestacp-webhosting
2331
```
2432

25-
## License
33+
## Running Tests
2634

27-
The VestaCP Webhosting 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](LICENSE) 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\\MyAdminVestaCP\\": "src/"
3836
}
37+
},
38+
"autoload-dev": {
39+
"psr-4": {
40+
"Detain\\MyAdminVestaCP\\Tests\\": "tests/"
41+
}
3942
}
4043
}

phpunit.xml.dist

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="vendor/autoload.php"
5+
cacheResultFile=".phpunit.cache/test-results"
6+
colors="true"
7+
executionOrder="depends,defects"
8+
forceCoversAnnotation="false"
9+
beStrictAboutCoversAnnotation="true"
10+
beStrictAboutOutputDuringTests="true"
11+
beStrictAboutTodoAnnotatedTests="true"
12+
convertDeprecationsToExceptions="true"
13+
failOnRisky="true"
14+
failOnWarning="true"
15+
verbose="true">
16+
<testsuites>
17+
<testsuite name="Unit">
18+
<directory suffix="Test.php">tests</directory>
19+
</testsuite>
20+
</testsuites>
21+
<coverage cacheDirectory=".phpunit.cache/code-coverage"
22+
processUncoveredFiles="true">
23+
<include>
24+
<directory suffix=".php">src</directory>
25+
</include>
26+
</coverage>
27+
</phpunit>

0 commit comments

Comments
 (0)