-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
123 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
unittest: | ||
parameters: | ||
php-version: | ||
type: string | ||
plugin-name: | ||
type: string | ||
default: "get" | ||
docker: | ||
- image: hillliu/pmvc-phpunit:<< parameters.php-version >> | ||
working_directory: /var/www/<< parameters.plugin-name >> | ||
steps: | ||
- checkout | ||
- run: | ||
name: "Display information" | ||
command: | | ||
date | ||
php -v | ||
php -m | ||
php -r "if(function_exists('gd_info'))print_r(gd_info());" | ||
composer --version | ||
phpunit --version | ||
- run: | ||
name: Composer install packages | ||
command: | | ||
composer update | ||
composer install --prefer-source | ||
- run: | ||
name: PHPUnit | ||
command: | | ||
ENABLE_COVERAGE=false | ||
if [ "<< parameters.php-version >>" == "8.1" ] && [ "$ENABLE_COVERAGE" == "true" ]; then | ||
XDEBUG_MODE=coverage phpunit --coverage-clover clover.xml | ||
coveralls --coverage_clover=clover.xml -v -o coveralls-upload.json | ||
else | ||
phpunit | ||
fi | ||
- store_artifacts: | ||
path: /var/www/<< parameters.plugin-name >>/clover.xml | ||
- store_artifacts: | ||
path: /var/www/<< parameters.plugin-name >>/coveralls-upload.json | ||
|
||
workflows: | ||
run-job: | ||
jobs: | ||
- unittest: | ||
matrix: | ||
parameters: | ||
php-version: ["8.1", "8.0", "5.6"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
vendor | ||
composer.lock | ||
.php_cs.cache | ||
.phpunit.result.cache | ||
.*.sw? |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
{ | ||
"name": "pmvc-plugin/get", | ||
"description": "smart get function, help you get configure from different storage simply. ", | ||
"type": "library", | ||
"keywords": ["get", "pmvc", "plug-in"], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Hill", | ||
"email": "hill@kimo.com" | ||
} | ||
], | ||
"require": { | ||
"pmvc/pmvc": "*" | ||
}, | ||
"minimum-stability": "dev" | ||
"name": "pmvc-plugin/get", | ||
"description": "smart get function, help you get configure from different storage simply. ", | ||
"type": "library", | ||
"keywords": ["get", "pmvc", "plug-in"], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Hill", | ||
"email": "hill@kimo.com" | ||
} | ||
], | ||
"require": { | ||
"pmvc/pmvc": "*" | ||
}, | ||
"require-dev": { | ||
"pmvc-plugin/unit": "*" | ||
}, | ||
"minimum-stability": "dev" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace PMVC\PlugIn\get; | ||
|
||
use UnexpectedValueException; | ||
|
||
${_INIT_CONFIG}[_CLASS] = __NAMESPACE__.'\UnexpectedKeyException'; | ||
|
||
class UnexpectedKeyException | ||
{ | ||
public function __invoke() | ||
{ | ||
$message = '[PlugIn:get] should not pass key with null'; | ||
throw new UnexpectedValueException($message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
<?php | ||
|
||
$path = __DIR__.'/../vendor/autoload.php'; | ||
$path = __DIR__ . '/../vendor/autoload.php'; | ||
include $path; | ||
|
||
if (!class_exists('PHPUnit_Framework_TestCase')) { | ||
class PHPUnit_Framework_TestCase extends | ||
\PHPUnit\Framework\TestCase | ||
{ | ||
} | ||
class PHPUnit_Framework_Error extends | ||
\PHPUnit\Framework\Error\Notice | ||
{ | ||
} | ||
} | ||
|
||
\PMVC\Load::plug(); | ||
\PMVC\addPlugInFolders([__DIR__.'/../../']); | ||
\PMVC\Load::plug( | ||
[ | ||
'unit' => null, | ||
], | ||
[__DIR__ . '/../../'] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters