Skip to content

Commit e535804

Browse files
authored
Laravel 11 (#25)
* update dev dependencies Fix styling Fix styling * Laravel 11
1 parent 11c9092 commit e535804

File tree

7 files changed

+78
-88
lines changed

7 files changed

+78
-88
lines changed

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '8.1'
19+
php-version: "8.3"
2020
coverage: none
2121

2222
- name: Install composer dependencies

.github/workflows/run-tests.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,21 @@ jobs:
1010
test:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
13-
fail-fast: true
13+
fail-fast: false
1414
matrix:
1515
os: [ubuntu-latest]
16-
php: [8.1, 8.2]
17-
laravel: [10.*]
18-
elasticsearch: ["7.17.4", "8.6.2"]
16+
php: [8.1, 8.2, 8.3]
17+
laravel: [10.*, 11.*]
18+
elasticsearch: ["7.17.18", "8.12.2"]
1919
stability: [prefer-lowest, prefer-stable]
2020
include:
2121
- laravel: 10.*
2222
testbench: 8.*
23+
- laravel: 11.*
24+
testbench: 9.*
25+
exclude:
26+
- laravel: 11.*
27+
php: 8.1
2328

2429
name: P${{ matrix.php }} - L${{ matrix.laravel }} - E${{ matrix.elasticsearch }} - ${{ matrix.stability }} - ${{ matrix.os }}
2530

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
],
1818
"require": {
1919
"php": "^8.1",
20-
"laravel/framework": "^10.0",
21-
"ruflin/elastica": "^7.1",
20+
"laravel/framework": "^10.0 || ^11.0",
21+
"ruflin/elastica": "^7.1 || 8.x-dev",
2222
"spatie/laravel-package-tools": "^1.13.0"
2323
},
2424
"require-dev": {
2525
"driftingly/rector-laravel": "^1.0",
2626
"larastan/larastan": "^2.9.2",
2727
"laravel/pint": "^1.14.0",
28-
"nunomaduro/collision": "^7.10.0",
29-
"orchestra/testbench": "^8.22.0",
28+
"nunomaduro/collision": "^7.10.0 || ^8.1.1",
29+
"orchestra/testbench": "^8.22.0 || ^9.0",
3030
"phpstan/extension-installer": "^1.3.1",
3131
"phpstan/phpstan-deprecation-rules": "^1.1.4",
3232
"phpstan/phpstan-phpunit": "^1.3.16",

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
return RectorConfig::configure()
1111
->withPreparedSets()
1212
->withSets([
13-
LaravelSetList::LARAVEL_100,
13+
LaravelSetList::LARAVEL_110,
1414
])
1515
->withPhpSets()
1616
->withPaths([

tests/TestCase.php

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Limenet\LaravelElasticaBridge\Tests;
66

77
use Illuminate\Database\Eloquent\Factories\Factory;
8-
use Illuminate\Foundation\Testing\RefreshDatabase;
8+
use Illuminate\Database\Schema\Blueprint;
99
use Limenet\LaravelElasticaBridge\LaravelElasticaBridgeServiceProvider;
1010
use Limenet\LaravelElasticaBridge\Tests\App\Elasticsearch\CustomerIndex;
1111
use Limenet\LaravelElasticaBridge\Tests\App\Elasticsearch\InvoiceIndex;
@@ -16,12 +16,12 @@
1616

1717
class TestCase extends Orchestra
1818
{
19-
use RefreshDatabase;
20-
2119
protected function setUp(): void
2220
{
2321
parent::setUp();
2422

23+
$this->setUpDatabase();
24+
2525
Factory::guessFactoryNamesUsing(
2626
fn (string $modelName) => 'Limenet\\LaravelElasticaBridge\\Tests\\Database\\Factories\\'.class_basename($modelName).'Factory'
2727
);
@@ -51,10 +51,67 @@ protected function getPackageProviders($app)
5151
];
5252
}
5353

54-
protected function defineEnvironment($app): void
54+
protected function setUpDatabase()
5555
{
56-
$migration = include __DIR__.'/database/migrations/SetupTables.php';
56+
$schema = $this->app['db']->connection()->getSchemaBuilder();
57+
58+
$schema->create('customers', function (Blueprint $table): void {
59+
$table->increments('id');
60+
$table->string('name');
61+
$table->string('email');
62+
$table->string('type');
63+
$table->timestamps();
64+
});
65+
66+
$schema->create('invoices', function (Blueprint $table): void {
67+
$table->uuid()->primary();
68+
$table->string('status');
69+
$table->timestamps();
70+
});
71+
72+
$schema->create('products', function (Blueprint $table): void {
73+
$table->increments('id');
74+
$table->string('name');
75+
$table->timestamps();
76+
});
77+
78+
$schema->create('orders', function (Blueprint $table): void {
79+
$table->increments('id');
80+
$table->dateTime('ordered_at');
81+
$table->timestamps();
82+
});
83+
84+
$schema->create('failed_jobs', function (Blueprint $table): void {
85+
$table->id();
86+
$table->string('uuid')->unique();
87+
$table->text('connection');
88+
$table->text('queue');
89+
$table->longText('payload');
90+
$table->longText('exception');
91+
$table->timestamp('failed_at')->useCurrent();
92+
});
93+
94+
$schema->create('jobs', function (Blueprint $table): void {
95+
$table->bigIncrements('id');
96+
$table->string('queue')->index();
97+
$table->longText('payload');
98+
$table->unsignedTinyInteger('attempts');
99+
$table->unsignedInteger('reserved_at')->nullable();
100+
$table->unsignedInteger('available_at');
101+
$table->unsignedInteger('created_at');
102+
});
57103

58-
$migration->up();
104+
$schema->create('job_batches', function (Blueprint $table): void {
105+
$table->string('id')->primary();
106+
$table->string('name');
107+
$table->integer('total_jobs');
108+
$table->integer('pending_jobs');
109+
$table->integer('failed_jobs');
110+
$table->text('failed_job_ids');
111+
$table->text('options')->nullable();
112+
$table->integer('cancelled_at')->nullable();
113+
$table->integer('created_at');
114+
$table->integer('finished_at')->nullable();
115+
});
59116
}
60117
}

tests/database/migrations/.gitkeep

Whitespace-only changes.

tests/database/migrations/SetupTables.php

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)