Skip to content

Commit 009acb4

Browse files
authored
Merge pull request #51 from bavix/11.x
[11.x] wallet
2 parents 711bedc + c998c22 commit 009acb4

File tree

4 files changed

+112
-7
lines changed

4 files changed

+112
-7
lines changed

.github/workflows/phpunits.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818

1919
strategy:
2020
matrix:
21-
wallet-versions: [ 10.1, "10.0", 9.6, 9.5, 9.4, 8.4, 7.3 ]
22-
php-versions: [ 8.3 ]
23-
databases: [ pgsql, mysql ]
21+
wallet-versions: [ "11.0", 10.1, 9.6, 8.4, 7.3 ]
22+
php-versions: [ 8.2, 8.3 ]
23+
databases: [ pgsql, mysql, testing ]
2424
caches: [ redis, memcached ]
2525

2626
services:

composer_11.0.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "bavix/laravel-wallet-benchmark",
3+
"description": "Testing performance laravel-wallet from version to version.",
4+
"keywords": [
5+
"benchmark",
6+
"laravel",
7+
"bavix",
8+
"command",
9+
"laravel-wallet",
10+
"virtual",
11+
"wallet",
12+
"payments"
13+
],
14+
"minimum-stability": "dev",
15+
"prefer-stable" : true,
16+
"homepage": "https://github.com/bavix/laravel-wallet-benchmark",
17+
"license": "MIT",
18+
"authors": [
19+
{
20+
"name": "Babichev Maxim",
21+
"email": "info@babichev.net"
22+
}
23+
],
24+
"require": {
25+
"php": "^8.2",
26+
"bavix/laravel-wallet": "dev-master"
27+
},
28+
"require-dev": {
29+
"brianium/paratest": "^7.4",
30+
"nunomaduro/collision": "^8.0",
31+
"orchestra/testbench": "^9.0",
32+
"phpunit/phpunit": "^10.5",
33+
"rector/rector": "^0.19",
34+
"symplify/easy-coding-standard": "^12.1"
35+
},
36+
"autoload": {
37+
"psr-4": {
38+
"Bavix\\WalletBench\\Test\\": "tests/"
39+
}
40+
},
41+
"scripts": {
42+
"unit":"@php vendor/bin/phpunit --coverage-xml=build/coverage-xml --log-junit=build/junit.xml",
43+
"paraunit":"@php vendor/bin/paratest --coverage-xml=build/coverage-xml --log-junit=build/junit.xml",
44+
"parabench":"@php ./vendor/bin/testbench package:test --coverage-xml=build/coverage-xml --log-junit=build/junit.xml",
45+
"ecs": "@php vendor/bin/ecs check",
46+
"ecs-fix": "@php vendor/bin/ecs check --fix",
47+
"ecs-cc": "@php vendor/bin/ecs --clear-cache",
48+
"rector": "@php vendor/bin/rector process --dry-run",
49+
"rector-fix": "@php vendor/bin/rector process"
50+
},
51+
"config": {
52+
"sort-packages": true
53+
}
54+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Illuminate\Database\Migrations\Migration;
6+
use Illuminate\Database\Schema\Blueprint;
7+
use Illuminate\Support\Facades\Schema;
8+
9+
return new class() extends Migration {
10+
/**
11+
* Run the migrations.
12+
*/
13+
public function up(): void
14+
{
15+
if (!Schema::hasTable('cache')) {
16+
Schema::create('cache', static function (Blueprint $table) {
17+
$table->string('key')
18+
->primary();
19+
$table->mediumText('value');
20+
$table->integer('expiration');
21+
});
22+
}
23+
24+
if (!Schema::hasTable('cache_locks')) {
25+
Schema::create('cache_locks', static function (Blueprint $table) {
26+
$table->string('key')
27+
->primary();
28+
$table->string('owner');
29+
$table->integer('expiration');
30+
});
31+
}
32+
}
33+
34+
/**
35+
* Reverse the migrations.
36+
*/
37+
public function down(): void
38+
{
39+
if (Schema::hasTable('cache')) {
40+
Schema::dropIfExists('cache');
41+
}
42+
43+
if (Schema::hasTable('cache_locks')) {
44+
Schema::dropIfExists('cache_locks');
45+
}
46+
}
47+
};

tests/Infra/TestCase.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ protected function getEnvironmentSetUp($app): void
6666
/** @var Repository $config */
6767
$config = $app['config'];
6868

69-
$mysql = $config->get('database.connections.mysql');
70-
$config->set('database.connections.mariadb', array_merge($mysql, [
71-
'port' => 3307,
72-
]));
69+
if ($config->get('database.connections.mariadb') === null) {
70+
$mysql = $config->get('database.connections.mysql');
71+
$config->set('database.connections.mariadb', array_merge($mysql, [
72+
'port' => 3307,
73+
]));
74+
} else {
75+
$config->set('database.connections.mariadb.port', 3307);
76+
}
7377

7478
$config->set('wallet.cache.ttl'); // remove ttl
7579

0 commit comments

Comments
 (0)