build(hyperf): 迁移到 hyperf3.1

This commit is contained in:
李东云
2024-02-27 15:25:18 +08:00
parent 4d1b5d2ab7
commit d12858dda8
6 changed files with 2607 additions and 1041 deletions

View File

@@ -14,24 +14,24 @@
}
},
"require": {
"php": ">=8.1",
"php": ">=8.2",
"composer/composer": ">=2.5.8",
"hyperf/guzzle": "~3.0.0",
"moneyphp/money": "^4.1",
"singularity/hdk-core": "^1.0.0",
"hyperf/contract": "~3.0.0",
"hyperf/constants": "3.0.*",
"hyperf/config": "~3.0.0",
"hyperf/di": "~3.0.0",
"hyperf/http-server": "3.0.*"
"hyperf/contract": "~3.1.0",
"hyperf/constants": "3.1.*",
"hyperf/config": "~3.1.0",
"hyperf/di": "~3.1.0",
"hyperf/http-server": "3.1.*"
},
"require-dev": {
"cooper/hyperf-pest": "^1.1",
"firebase/php-jwt": "^6.8.0",
"phpunit/phpunit": "^9.6.9",
"hyperf/testing": "^3.1",
"friendsofhyperf/pest-plugin-hyperf": "3.1.*",
"swoole/ide-helper": "^4.8.13"
},
"minimum-stability": "alpha",
"minimum-stability": "beta",
"prefer-stable": true,
"config": {
"optimize-autoloader": true,
@@ -47,7 +47,7 @@
"test": [
"rm -rf runtime",
"Composer\\Config::disableProcessTimeout",
"co-pest --prepend tests/bootstrap.php -c phpunit.xml --colors=always"
"APP_STATUS=false pest --coroutine --prepend=tests/bootstrap.php --colors=always $1"
],
"cs-fix": "php-cs-fixer fix $1",
"analyse": "phpstan analyse --memory-limit 300M -l 0 -c phpstan.neon ./app ./config"

3609
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php"
colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd">
<coverage/>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
>
<testsuites>
<testsuite name="Pest">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source/>
</phpunit>

View File

@@ -1,10 +1,9 @@
#!/usr/bin/env sh
docker run \
--pull always \
-ti --rm --name "hdk-pay" \
-w "/srv/www" \
-v "$(pwd)":/srv/www \
-v ~/.ssh:/root/.ssh \
harbor.luxcreo.cn/library/hyperf:8.1-swoole /bin/ash
harbor.luxcreo.cn/library/hyperf:8.2-swoole /bin/ash

View File

@@ -21,7 +21,7 @@ test(
* @throws GuzzleException
*/
function () {
$service = new GoodsRpc('http://192.168.2.218:9611');
$service = new GoodsRpc('http://192.168.2.246:9611');
$goods = $service->find(
1,
[

View File

@@ -18,7 +18,7 @@ use Singularity\HDK\Pay\Sdk\StripeRpc;
test('能够正常创建 Stripe 订单', function () {
/** @var StripeRpc $service */
$service = \Hyperf\Support\make(StripeRpc::class, ['baseUrl' => 'http://192.168.2.218:9611']);
$service = \Hyperf\Support\make(StripeRpc::class, ['baseUrl' => 'http://192.168.2.246:9611']);
$order = $service->createSession(
money: Money::USD(51),
uid: uniqid('NAT_'),
@@ -33,7 +33,7 @@ test('能够正常创建 Stripe 订单', function () {
test('能够正常获取 Stripe 配置信息', function () {
/** @var StripeRpc $service */
$service = \Hyperf\Support\make(StripeRpc::class, ['baseUrl' => 'http://192.168.2.218:9611']);
$service = \Hyperf\Support\make(StripeRpc::class, ['baseUrl' => 'http://192.168.2.246:9611']);
$configures = $service->getConfigurations();
expect($configures)