Skip to content

Commit b347188

Browse files
committed
- Adding Laravel 13 support
1 parent 9a8a5e2 commit b347188

3 files changed

Lines changed: 26 additions & 16 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ jobs:
1717
matrix:
1818
os: [ ubuntu-latest ]
1919
php: [ 8.4, 8.3, 8.2, 8.1 ]
20-
laravel: [ 12.*, 11.*, 10.*, 9.* ]
20+
laravel: [ 13.*, 12.*, 11.*, 10.*, 9.* ]
2121
stability: [ prefer-lowest, prefer-stable ]
2222
include:
23+
- laravel: 13.*
24+
testbench: 11.*
25+
carbon: ^3.8.4
2326
- laravel: 12.*
2427
testbench: 10.*
2528
carbon: ^3.8.4
2629
- laravel: 11.*
27-
testbench: 9.*
30+
testbench: ^9.16
2831
carbon: ^2.63
2932
- laravel: 10.*
3033
testbench: 8.*
@@ -33,6 +36,10 @@ jobs:
3336
testbench: 7.*
3437
carbon: ^2.63
3538
exclude:
39+
- laravel: 13.*
40+
php: 8.2
41+
- laravel: 13.*
42+
php: 8.1
3643
- laravel: 12.*
3744
php: 8.1
3845
- laravel: 11.*
@@ -54,7 +61,7 @@ jobs:
5461
with:
5562
php-version: ${{ matrix.php }}
5663
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
57-
coverage: ${{ startsWith(github.event.head_commit.message, 'coverage') && matrix.php == '8.3' && matrix.laravel == '11.*' && matrix.stability == 'prefer-stable' && 'xdebug' || 'none' }}
64+
coverage: ${{ startsWith(github.event.head_commit.message, 'coverage') && matrix.php == '8.4' && matrix.laravel == '13.*' && matrix.stability == 'prefer-stable' && 'xdebug' || 'none' }}
5865

5966
- name: Install dependencies
6067
run: |
@@ -63,10 +70,10 @@ jobs:
6370
6471
- name: Execute tests
6572
run: |
66-
vendor/bin/phpunit ${{ startsWith(github.event.head_commit.message, 'coverage') && matrix.php == '8.3' && matrix.laravel == '11.*' && matrix.stability == 'prefer-stable' && '--coverage-clover=clover.xml' || '' }}
73+
vendor/bin/phpunit ${{ startsWith(github.event.head_commit.message, 'coverage') && matrix.php == '8.4' && matrix.laravel == '13.*' && matrix.stability == 'prefer-stable' && '--coverage-clover=clover.xml' || '' }}
6774
6875
- name: Make code coverage badge
69-
if: startsWith(github.event.head_commit.message, 'coverage') && matrix.php == '8.3' && matrix.laravel == '11.*' && matrix.stability == 'prefer-stable'
76+
if: startsWith(github.event.head_commit.message, 'coverage') && matrix.php == '8.4' && matrix.laravel == '13.*' && matrix.stability == 'prefer-stable'
7077
uses: timkrase/phpunit-coverage-badge@v1.2.1
7178
with:
7279
coverage_badge_path: .github/coverage.svg

composer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
],
1818
"require": {
1919
"php": "^8.1",
20-
"illuminate/support": "^9.0 || ^10.0 || ^11.0 || ^12.0",
20+
"illuminate/support": "^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0",
2121
"maatwebsite/excel": "^3.1"
2222
},
2323
"require-dev": {
2424
"laravel/pint": "^1.14",
25-
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0 || ^10.0",
26-
"phpunit/phpunit": "^9.5 || ^10.5 || ^11.5.3"
25+
"orchestra/testbench": "^7.0 || ^8.0 || ^9.16 || ^10.0 || ^11.0",
26+
"phpunit/phpunit": "^9.5 || ^10.5 || ^11.5.3 || ^12.5.8 || ^13.0.3"
2727
},
2828
"autoload": {
2929
"psr-4": {
@@ -45,6 +45,13 @@
4545
]
4646
}
4747
},
48+
"repositories": [
49+
{
50+
"type": "vcs",
51+
"url": "https://github.com/Javaabu/Laravel-Excel.git",
52+
"canonical": false
53+
}
54+
],
4855
"minimum-stability": "dev",
4956
"prefer-stable": true
5057
}

tests/Unit/ModelExportTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ class ModelExportTest extends TestCase
1313
{
1414
use RefreshDatabase;
1515

16-
/** @test */
17-
public function it_can_query_the_model(): void
16+
public function test_it_can_query_the_model(): void
1817
{
1918
$user = User::factory()->create();
2019

@@ -26,8 +25,7 @@ public function it_can_query_the_model(): void
2625
$this->assertTrue($result->contains('id', $user->id));
2726
}
2827

29-
/** @test */
30-
public function it_can_determine_the_allowed_attributes(): void
28+
public function test_it_can_determine_the_allowed_attributes(): void
3129
{
3230
$export = new UsersExport();
3331

@@ -46,8 +44,7 @@ public function it_can_determine_the_allowed_attributes(): void
4644
], $export->allowedAttributes());
4745
}
4846

49-
/** @test */
50-
public function it_only_includes_allowed_attributes(): void
47+
public function test_it_only_includes_allowed_attributes(): void
5148
{
5249
$role = Role::factory()->create([
5350
'name' => 'Test Role',
@@ -86,8 +83,7 @@ public function it_only_includes_allowed_attributes(): void
8683
], $export->map($user));
8784
}
8885

89-
/** @test */
90-
public function it_can_generate_headings(): void
86+
public function test_it_can_generate_headings(): void
9187
{
9288
$export = new UsersExport();
9389

0 commit comments

Comments
 (0)