Skip to content

Commit 83d1ff2

Browse files
Removed Laravel 10
1 parent fea899e commit 83d1ff2

27 files changed

+96
-100
lines changed

.github/workflows/phpunit.yml renamed to .github/workflows/tests.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ jobs:
1010
fail-fast: true
1111
matrix:
1212
php: [ "8.2", "8.3", "8.4" ]
13-
laravel: [ "10.0", "11.0", "12.0" ]
14-
exclude:
15-
- laravel: "10.0"
16-
php: "8.4"
13+
laravel: [ "11.0", "12.0" ]
1714

1815
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}
1916

@@ -31,9 +28,5 @@ jobs:
3128
- name: Install dependencies
3229
run: composer require --dev laravel/framework:^${{ matrix.laravel }}
3330

34-
- name: Install Doctrine
35-
if: matrix.laravel == '10.0'
36-
run: composer require doctrine/dbal
37-
3831
- name: Execute tests
3932
run: sudo vendor/bin/phpunit

composer.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,15 @@
4141
"php": "^8.2",
4242
"composer-runtime-api": "^2.2",
4343
"dragon-code/support": "^6.6",
44-
"illuminate/console": "^10.0 || ^11.0 || ^12.0",
45-
"illuminate/container": "^10.0 || ^11.0 || ^12.0",
46-
"illuminate/database": "^10.0 || ^11.0 || ^12.0",
47-
"illuminate/support": "^10.0 || ^11.0 || ^12.0",
44+
"laravel/framework": "^11.0 || ^12.0",
4845
"laravel/prompts": ">=0.1",
49-
"spatie/laravel-data": "^4.14",
50-
"symfony/console": "^6.0 || ^7.0"
46+
"spatie/laravel-data": "^4.14"
5147
},
5248
"require-dev": {
5349
"mockery/mockery": "^1.3.1",
5450
"nesbot/carbon": "^2.62.1 || ^3.0",
55-
"orchestra/testbench": "^8.0 || ^9.0 || ^10.0",
56-
"phpunit/phpunit": "^10.0 || ^11.0 || ^12.0",
57-
"ramsey/uuid": "^4.0"
51+
"orchestra/testbench": "^9.0 || ^10.0",
52+
"phpunit/phpunit": "^11.0 || ^12.0"
5853
},
5954
"conflict": {
6055
"andrey-helldar/laravel-actions": "*",

tests/Commands/MutexTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,6 @@ class MutexTest extends TestCase
1919

2020
protected MutexService $mutex;
2121

22-
protected function setUp(): void
23-
{
24-
$this->command = new class extends Command {
25-
public int $ran = 0;
26-
27-
public function handle(): int
28-
{
29-
++$this->ran;
30-
31-
return self::SUCCESS;
32-
}
33-
};
34-
35-
$this->mutex = m::mock(MutexService::class);
36-
37-
$container = Container::getInstance();
38-
$container->instance(MutexService::class, $this->mutex);
39-
$this->command->setLaravel($container);
40-
}
41-
4222
public function testCanRunIsolatedCommandIfNotBlocked()
4323
{
4424
$this->mutex->shouldReceive('create')
@@ -91,6 +71,26 @@ public function testCanRunCommandAgainNonAutomated()
9171
$this->assertEquals(1, $this->command->ran);
9272
}
9373

74+
protected function setUp(): void
75+
{
76+
$this->command = new class extends Command {
77+
public int $ran = 0;
78+
79+
public function handle(): int
80+
{
81+
++$this->ran;
82+
83+
return self::SUCCESS;
84+
}
85+
};
86+
87+
$this->mutex = m::mock(MutexService::class);
88+
89+
$container = Container::getInstance();
90+
$container->instance(MutexService::class, $this->mutex);
91+
$this->command->setLaravel($container);
92+
}
93+
9494
protected function runCommand($withIsolated = true)
9595
{
9696
$input = new ArrayInput(['--' . Options::Isolated => $withIsolated]);

tests/Concerns/AssertDatabase.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ protected function assertDatabaseDoesntTable(string $table): void
2424
);
2525
}
2626

27-
protected function assertDatabaseOperationHas(string $table, $value, $connection = null, string $column = 'operation'): void
28-
{
27+
protected function assertDatabaseOperationHas(
28+
string $table,
29+
$value,
30+
$connection = null,
31+
string $column = 'operation'
32+
): void {
2933
$this->assertDatabaseHasLike($table, $column, $value, $connection);
3034
}
3135

@@ -39,8 +43,12 @@ protected function assertDatabaseHasLike(string $table, string $column, $value,
3943
$this->assertTrue($exists);
4044
}
4145

42-
protected function assertDatabaseOperationDoesntLike(string $table, $value, $connection = null, string $column = 'operation'): void
43-
{
46+
protected function assertDatabaseOperationDoesntLike(
47+
string $table,
48+
$value,
49+
$connection = null,
50+
string $column = 'operation'
51+
): void {
4452
$this->assertDatabaseDoesntLike($table, $column, $value, $connection);
4553
}
4654

tests/fixtures/app/async/2021_04_06_212742_every_time.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
use DragonCode\LaravelDeployOperations\Operation;
66
use Illuminate\Database\Query\Builder;
77
use Illuminate\Support\Facades\DB;
8-
use Ramsey\Uuid\Uuid;
8+
use Illuminate\Support\Str;
99

1010
return new class extends Operation {
1111
public function __invoke(): void
1212
{
1313
$this->table()->insert([
14-
'value' => Uuid::uuid4(),
14+
'value' => Str::random(4),
1515
]);
1616
}
1717

tests/fixtures/app/async/2023_04_06_212637_foo_bar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
use DragonCode\LaravelDeployOperations\Operation;
66
use Illuminate\Database\Query\Builder;
77
use Illuminate\Support\Facades\DB;
8-
use Ramsey\Uuid\Uuid;
8+
use Illuminate\Support\Str;
99

1010
return new class extends Operation {
1111
public function __invoke(): void
1212
{
1313
$this->table()->insert([
14-
'value' => Uuid::uuid4(),
14+
'value' => Str::random(4),
1515
]);
1616
}
1717

tests/fixtures/app/operations/2020_12_07_153105_foo_bar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
use DragonCode\LaravelDeployOperations\Operation;
66
use Illuminate\Database\Query\Builder;
77
use Illuminate\Support\Facades\DB;
8-
use Ramsey\Uuid\Uuid;
8+
use Illuminate\Support\Str;
99

1010
return new class extends Operation {
1111
public function up(): void
1212
{
1313
$this->table()->insert([
14-
'value' => Uuid::uuid4(),
14+
'value' => Str::random(4),
1515
]);
1616
}
1717

tests/fixtures/app/operations/2021_01_02_020947_every_time.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
use DragonCode\LaravelDeployOperations\Operation;
66
use Illuminate\Database\Query\Builder;
77
use Illuminate\Support\Facades\DB;
8-
use Ramsey\Uuid\Uuid;
8+
use Illuminate\Support\Str;
99

1010
return new class extends Operation {
1111
public function up(): void
1212
{
1313
$this->table()->insert([
14-
'value' => Uuid::uuid4(),
14+
'value' => Str::random(4),
1515
]);
1616
}
1717

tests/fixtures/app/operations/2021_05_24_120003_run_on_all.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
use DragonCode\LaravelDeployOperations\Operation;
66
use Illuminate\Database\Query\Builder;
77
use Illuminate\Support\Facades\DB;
8-
use Ramsey\Uuid\Uuid;
8+
use Illuminate\Support\Str;
99

1010
return new class extends Operation {
1111
public function up(): void
1212
{
1313
$this->table()->insert([
14-
'value' => Uuid::uuid4(),
14+
'value' => Str::random(4),
1515
]);
1616
}
1717

1818
public function down(): void
1919
{
2020
$this->table()->insert([
21-
'value' => Uuid::uuid4(),
21+
'value' => Str::random(4),
2222
]);
2323
}
2424

tests/fixtures/app/operations/2021_05_24_120003_run_on_many_environments.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
use DragonCode\LaravelDeployOperations\Operation;
66
use Illuminate\Database\Query\Builder;
77
use Illuminate\Support\Facades\DB;
8-
use Ramsey\Uuid\Uuid;
8+
use Illuminate\Support\Str;
99

1010
return new class extends Operation {
1111
public function up(): void
1212
{
1313
$this->table()->insert([
14-
'value' => Uuid::uuid4(),
14+
'value' => Str::random(4),
1515
]);
1616
}
1717

1818
public function down(): void
1919
{
2020
$this->table()->insert([
21-
'value' => Uuid::uuid4(),
21+
'value' => Str::random(4),
2222
]);
2323
}
2424

0 commit comments

Comments
 (0)