Skip to content

Commit 61a3b77

Browse files
Merge 5.5 into 5.x (#3465)
2 parents 716990a + 8edd6a2 commit 61a3b77

File tree

7 files changed

+61
-33
lines changed

7 files changed

+61
-33
lines changed

.github/workflows/build-ci-atlas.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- "[0-9]+.[0-9x]+"
7-
- "feature/*"
87
pull_request:
98
branches:
109
- "[0-9]+.[0-9x]+"
@@ -16,28 +15,34 @@ env:
1615

1716
jobs:
1817
build:
19-
runs-on: "${{ matrix.os }}"
18+
runs-on: "ubuntu-latest"
2019

2120
name: "PHP/${{ matrix.php }} Laravel/${{ matrix.laravel }} Driver/${{ matrix.driver }}"
2221

2322
strategy:
2423
matrix:
25-
os:
26-
- "ubuntu-latest"
2724
php:
2825
- "8.2"
2926
- "8.3"
3027
- "8.4"
28+
- "8.5"
3129
laravel:
32-
- "11.*"
3330
- "12.*"
3431
driver:
35-
- 1
32+
- 2
3633
include:
34+
# Test Laravel 10
35+
- php: "8.1"
36+
laravel: "10.*"
37+
driver: 1
38+
# Test Laravel 11
39+
- php: "8.2"
40+
laravel: "11.*"
41+
driver: 1
42+
# Test Driver v1
3743
- php: "8.4"
3844
laravel: "12.*"
39-
os: "ubuntu-latest"
40-
driver: 2
45+
driver: 1
4146

4247
steps:
4348
- uses: "actions/checkout@v6"

.github/workflows/build-ci.yml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- "[0-9]+.[0-9x]+"
7-
- "feature/*"
87
pull_request:
98
branches:
109
- "[0-9]+.[0-9x]+"
@@ -16,53 +15,63 @@ env:
1615

1716
jobs:
1817
build:
19-
runs-on: "${{ matrix.os }}"
18+
runs-on: "ubuntu-latest"
2019

2120
name: "PHP/${{ matrix.php }} Laravel/${{ matrix.laravel }} Driver/${{ matrix.driver }} Server/${{ matrix.mongodb }} ${{ matrix.mode }}"
2221

2322
strategy:
2423
matrix:
25-
os:
26-
- "ubuntu-latest"
2724
mongodb:
28-
- "4.4"
29-
- "5.0"
30-
- "6.0"
31-
- "7.0"
3225
- "8.0"
3326
php:
34-
- "8.1"
3527
- "8.2"
3628
- "8.3"
3729
- "8.4"
30+
- "8.5"
3831
laravel:
39-
- "10.*"
40-
- "11.*"
4132
- "12.*"
4233
driver:
4334
- 2
4435
include:
36+
# Test Lowest dependencies
4537
- php: "8.1"
4638
laravel: "10.*"
4739
mongodb: "5.0"
4840
mode: "low-deps"
49-
os: "ubuntu-latest"
5041
driver: 1
42+
# Test Driver v1
5143
- php: "8.3"
52-
laravel: "11.*"
53-
mongodb: "8.0"
54-
os: "ubuntu-latest"
44+
laravel: "10.*"
45+
mongodb: "4.4"
5546
driver: 1
5647
- php: "8.4"
5748
laravel: "12.*"
5849
mongodb: "8.0"
59-
os: "ubuntu-latest"
6050
driver: 1
61-
exclude:
62-
- php: "8.1"
51+
# Test Laravel 10
52+
- php: "8.5"
53+
laravel: "10.*"
54+
mongodb: "8.0"
55+
# Test Laravel 11
56+
- php: "8.5"
6357
laravel: "11.*"
64-
- php: "8.1"
58+
mongodb: "8.0"
59+
# Test all server versions with the lowest PHP and latest Laravel
60+
- php: "8.2"
61+
laravel: "12.*"
62+
mongodb: "4.4"
63+
- php: "8.2"
64+
laravel: "12.*"
65+
mongodb: "5.0"
66+
- php: "8.2"
6567
laravel: "12.*"
68+
mongodb: "6.0"
69+
- php: "8.2"
70+
laravel: "12.*"
71+
mongodb: "7.0"
72+
- php: "8.2"
73+
laravel: "12.*"
74+
mongodb: "8.0"
6675

6776
steps:
6877
- uses: "actions/checkout@v6"

.github/workflows/coding-standards.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- "[0-9]+.[0-9x]+"
7-
- "feature/*"
87
pull_request:
98
branches:
109
- "[0-9]+.[0-9x]+"

.github/workflows/merge-up.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- "[0-9]+.[0-9x]+"
7-
- "feature/*"
87

98
env:
109
GH_TOKEN: ${{ secrets.MERGE_UP_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- "[0-9]+.[0-9x]+"
7-
- "feature/*"
87
pull_request:
98
branches:
109
- "[0-9]+.[0-9x]+"
@@ -17,7 +16,7 @@ on:
1716
required: true
1817

1918
env:
20-
PHP_VERSION: "8.2"
19+
PHP_VERSION: "8.5"
2120
DRIVER_VERSION: "stable"
2221
MONGODB_EXT_V1: mongodb-1.21.0
2322
MONGODB_EXT_V2: mongodb-mongodb/mongo-php-driver@v2.x
@@ -34,9 +33,12 @@ jobs:
3433
- '8.2'
3534
- '8.3'
3635
- '8.4'
36+
- '8.5'
3737
driver:
38-
- 1
3938
- 2
39+
include:
40+
- php: "8.4"
41+
driver: 1
4042
steps:
4143
- name: Checkout
4244
uses: actions/checkout@v6

src/Scout/ScoutEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function update($models)
151151
#[Override]
152152
public function delete($models): void
153153
{
154-
assert($models instanceof EloquentCollection, new TypeError(sprintf('Argument #1 ($models) must be of type %s, %s given', Collection::class, get_debug_type($models))));
154+
assert($models instanceof EloquentCollection, new TypeError(sprintf('Argument #1 ($models) must be of type %s, %s given', EloquentCollection::class, get_debug_type($models))));
155155

156156
if ($models->isEmpty()) {
157157
return;

tests/Scout/ScoutEngineTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use MongoDB\Laravel\Tests\Scout\Models\SearchableModel;
2222
use MongoDB\Laravel\Tests\TestCase;
2323
use PHPUnit\Framework\Attributes\DataProvider;
24+
use TypeError;
2425

2526
use function array_replace_recursive;
2627
use function count;
@@ -670,4 +671,17 @@ public function testDeleteWithRemoveableScoutCollection(): void
670671
$engine = new ScoutEngine($database, softDelete: false);
671672
$engine->delete($job->models);
672673
}
674+
675+
public function testDeleteRejectsNonEloquentCollection(): void
676+
{
677+
$database = $this->createMock(Database::class);
678+
$engine = new ScoutEngine($database, softDelete: false);
679+
680+
$this->expectException(TypeError::class);
681+
$this->expectExceptionMessage(
682+
'Argument #1 ($models) must be of type Illuminate\Database\Eloquent\Collection',
683+
);
684+
685+
$engine->delete(LaravelCollection::make([1, 2, 3]));
686+
}
673687
}

0 commit comments

Comments
 (0)