Skip to content

Commit 69e4742

Browse files
Merge pull request #23 from bedus-creation/laravel-10.x
feat(10x): laravel bump to 10x
2 parents 3203553 + 4c5da84 commit 69e4742

9 files changed

+72
-113
lines changed

.github/workflows/run-tests-L10.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "Run Tests - Current"
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
php: [ 8.1 ]
12+
laravel: [ 10.* ]
13+
dependency-version: [ prefer-lowest, prefer-stable ]
14+
include:
15+
- laravel: 10.*
16+
testbench: 8.*
17+
18+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
19+
20+
steps:
21+
- name: Update apt
22+
run: sudo apt-get update --fix-missing
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
27+
- name: Cache dependencies
28+
uses: actions/cache@v2
29+
with:
30+
path: ~/.composer/cache/files
31+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
32+
33+
- name: Setup PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php }}
37+
extensions: gd, curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
38+
coverage: none
39+
40+
- name: Install dependencies
41+
run: |
42+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "symfony/console:>=4.3.4" --no-interaction --no-update
43+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
44+
- name: Execute tests
45+
run: vendor/bin/phpunit

.github/workflows/run-tests-L8.yml

-45
This file was deleted.

.github/workflows/run-tests-L9.yml

-45
This file was deleted.

composer.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
"license": "MIT",
1818
"type": "library",
1919
"require": {
20-
"php": "^7.4|^8.0",
21-
"illuminate/http": "^8.0|^9.0",
22-
"illuminate/database": "^8.0|^9.0",
23-
"illuminate/support": "^8.0|^9.0",
24-
"intervention/image": "^2.5",
25-
"ext-json": "*",
26-
"ext-gd": "*"
20+
"php": "^8.1",
21+
"ext-json": "*",
22+
"ext-gd": "*",
23+
"illuminate/http": "^10.0",
24+
"illuminate/database": "^10.0",
25+
"illuminate/support": "^10.0",
26+
"intervention/image": "^2.5"
2727
},
2828
"require-dev": {
29-
"phpunit/phpunit": "^8.0|^9.0",
30-
"orchestra/testbench": "^6.0|^9.0"
29+
"phpunit/phpunit": "^9.0",
30+
"orchestra/testbench": "^8.0"
3131
},
3232
"autoload": {
3333
"psr-4": {
@@ -45,5 +45,6 @@
4545
"Aammui\\LaravelMedia\\LaravelMediaServiceProvider"
4646
]
4747
}
48-
}
48+
},
49+
"minimum-stability": "dev"
4950
}

phpunit.xml.dist

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
bootstrap="vendor/autoload.php"
34
backupGlobals="false"
45
backupStaticAttributes="false"
56
colors="true"
@@ -8,18 +9,19 @@
89
convertNoticesToExceptions="true"
910
convertWarningsToExceptions="true"
1011
processIsolation="false"
11-
stopOnFailure="false">
12+
stopOnFailure="false"
13+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
14+
<coverage>
15+
<include>
16+
<directory suffix=".php">src/</directory>
17+
</include>
18+
</coverage>
1219
<testsuites>
1320
<testsuite name="Permissions Test Suite">
1421
<directory>tests</directory>
1522
</testsuite>
1623
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory suffix=".php">src/</directory>
20-
</whitelist>
21-
</filter>
2224
<php>
2325
<env name="CACHE_DRIVER" value="array"/>
2426
</php>
25-
</phpunit>
27+
</phpunit>

readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ composer require aammui/laravel-media
1919

2020
| Laravel Version | Role Permission Version | Installation |
2121
|-----------------|-------------------------|---------------------------------------------------|
22+
| 10.x | | ```composer require aammui/laravel-media:3.0.0``` |
2223
| 9.x | 2.0.0 | ```composer require aammui/laravel-media:2.0.0``` |
2324
| 8.x, 7.x, 6.x | 1.0.0 | ```composer require aammui/laravel-media:1.0.0``` |
2425

tests/DocumentTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function document_can_attached_to_a_model()
2121

2222
// Assert built url is valid
2323
foreach (Responsive::getConfig() as $key => $responsive) {
24-
$this->assertRegExp("/http:\/\/localhost\/documents\/.*/", $model->getMedia()->first()->link($key));
24+
$this->assertMatchesRegularExpression("/http:\/\/localhost\/documents\/.*/", $model->getMedia()->first()->link($key));
2525
}
2626
}
2727
}

tests/ExtensionTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function it_detects_if_the_given_extension_is_image($extension)
2222
}
2323

2424
/**
25-
* @dataProvider docuementExtensionProvider
25+
* @dataProvider documentExtensionProvider
2626
*
2727
* @test
2828
*/
@@ -34,7 +34,7 @@ public function it_detects_if_the_given_extension_is_documents($extension)
3434
/**
3535
* @return \string[][]
3636
*/
37-
public function imageExtensionProvider(): array
37+
public static function imageExtensionProvider(): array
3838
{
3939
return [
4040
["jpg"],
@@ -45,7 +45,7 @@ public function imageExtensionProvider(): array
4545
/**
4646
* @return \string[][]
4747
*/
48-
public function docuementExtensionProvider(): array
48+
public static function documentExtensionProvider(): array
4949
{
5050
return [
5151
["pdf"],

tests/ResponsiveImageTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function it_generates_valid_url_for_all_the_responsive_images()
4343

4444
// Assert built url is valid
4545
foreach (Responsive::getConfig() as $key => $responsive) {
46-
$this->assertRegExp(
46+
$this->assertMatchesRegularExpression(
4747
"/http:\/\/localhost\/{$key}\/.*/", $model->getMedia()
4848
->first()
4949
->link($key)

0 commit comments

Comments
 (0)