Skip to content

Commit 130b7c0

Browse files
authored
Added support php 8.3 (#12)
* added support php 8.3|8.4
1 parent f294c2d commit 130b7c0

File tree

6 files changed

+66
-67
lines changed

6 files changed

+66
-67
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ on:
1919
- unassigned
2020

2121
env:
22-
php_extensions: 'apcu, bcmath, ctype, curl, dom, iconv, intl, json, mbstring, opcache, openssl, pdo, pdo_pgsql, pcntl, pcov, posix, redis, session, simplexml, sockets, tokenizer, xml, xmlwriter, zip'
22+
php_extensions: 'apcu, bcmath, ctype, curl, dom, iconv, intl, json, mbstring, opcache, openssl, pdo, pdo_pgsql, pcntl, pcov, posix, redis, session, simplexml, sockets, tokenizer, xml, xmlwriter, zip, xdebug'
2323
key: cache-v0.1
2424
DB_USER: 'postgres'
25-
DB_NAME: 'testing'
25+
DB_NAME: 'postgres'
2626
DB_PASSWORD: 'postgres'
2727
DB_HOST: '127.0.0.1'
2828

@@ -33,11 +33,11 @@ jobs:
3333
strategy:
3434
matrix:
3535
operating_system: [ubuntu-latest]
36-
php_versions: ['7.4']
36+
php_versions: ['8.3']
3737
fail-fast: false
3838
env:
3939
PHP_CS_FIXER_FUTURE_MODE: '0'
40-
name: 'Lint PHP'
40+
name: 'Linter PHP'
4141
steps:
4242
- name: 'Checkout'
4343
uses: actions/checkout@v2
@@ -75,48 +75,18 @@ jobs:
7575
strategy:
7676
fail-fast: false
7777
matrix:
78-
coverage: [false]
78+
coverage: [true]
7979
experimental: [false]
8080
operating_system: [ubuntu-latest]
81-
postgres: ['9.6']
82-
laravel: ['^6.0']
83-
php_versions: ['7.4']
81+
postgres: ['11', '12', '13', '14', '15']
82+
laravel: ['^11.0']
83+
php_versions: ['8.3']
8484
include:
8585
- operating_system: ubuntu-latest
86-
postgres: '10'
87-
php_versions: '7.4'
88-
laravel: '^7.0'
89-
experimental: false
90-
coverage: true
91-
- operating_system: ubuntu-latest
92-
postgres: '11'
93-
php_versions: '7.4'
94-
laravel: '^8.0'
95-
experimental: false
96-
coverage: true
97-
- operating_system: ubuntu-latest
98-
postgres: '12'
99-
php_versions: '8.0'
100-
laravel: '^8.0'
101-
experimental: false
102-
coverage: true
103-
- operating_system: ubuntu-latest
104-
postgres: '13'
105-
php_versions: '8.0'
106-
laravel: '^9.0'
107-
experimental: false
108-
coverage: false
109-
- operating_system: ubuntu-latest
110-
postgres: '14'
111-
php_versions: '8.1'
112-
laravel: '^10.0'
113-
experimental: false
114-
coverage: false
115-
- operating_system: ubuntu-latest
116-
postgres: '15'
117-
php_versions: '8.2'
86+
postgres: '16'
87+
php_versions: '8.4'
11888
laravel: '^11.0'
119-
experimental: false
89+
experimental: true
12090
coverage: false
12191
runs-on: '${{ matrix.operating_system }}'
12292
services:
@@ -130,7 +100,7 @@ jobs:
130100
- 5432:5432
131101
# needed because the postgres container does not provide a healthcheck
132102
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
133-
name: 'Test / Laravel ${{ matrix.laravel }} / PHP ${{ matrix.php_versions }} / Postgres ${{ matrix.postgres }}'
103+
name: 'Testing / Laravel ${{ matrix.laravel }} / PHP ${{ matrix.php_versions }} / Postgres ${{ matrix.postgres }}'
134104
needs:
135105
- lint
136106
steps:
@@ -160,10 +130,11 @@ jobs:
160130
with:
161131
php-version: ${{ matrix.php_versions }}
162132
extensions: ${{ env.php_extensions }}
163-
ini-values: 'pcov.directory=src, date.timezone=UTC, upload_max_filesize=20M, post_max_size=20M, memory_limit=512M, short_open_tag=Off'
164-
coverage: pcov
133+
ini-values: 'pcov.directory=src, date.timezone=UTC, upload_max_filesize=20M, post_max_size=20M, memory_limit=512M, short_open_tag=Off, xdebug.mode="develop,coverage"'
134+
coverage: xdebug
165135
tools: 'phpunit'
166136
- name: 'Install PHP dependencies with Composer'
137+
continue-on-error: ${{ matrix.experimental }}
167138
run: |
168139
composer require "laravel/framework=${{ matrix.laravel }}" --no-update
169140
COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
@@ -192,6 +163,7 @@ jobs:
192163
-e "s/\${DATABASE}/${{ env.DB_NAME }}/" \
193164
-e "s/\${HOST}/${{ env.DB_HOST }}/" \
194165
phpunit.xml.dist > phpunit.xml
166+
./vendor/bin/phpunit -c phpunit.xml --migrate-configuration
195167
if [[ ${{ matrix.coverage }} == true ]]; then
196168
./vendor/bin/phpunit --stderr --coverage-clover build/logs/clover.xml --coverage-text
197169
else

composer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,18 @@
3535
}
3636
},
3737
"require": {
38-
"php": "^7.3|^7.4|^8.0|^8.1|^8.2",
39-
"illuminate/support": "^5.7|^6.20|^7.30|^8.20|^9.0|^10.0|^11.0",
40-
"illuminate/database": "^5.7|^6.20|^7.30|^8.20|^9.0|^10.0|^11.0",
41-
"illuminate/console": "^5.7|^6.20|^7.30|^8.20|^9.0|^10.0|^11.0"
38+
"php": "^8.3|^8.4",
39+
"illuminate/support": "^11.0",
40+
"illuminate/database": "^11.0",
41+
"illuminate/console": "^11.0"
4242
},
4343
"require-dev": {
44-
"phpunit/phpunit": "^7.3|^8.5|^9.4|^10.0|^11.0",
44+
"phpunit/phpunit": "^11.0",
4545
"php-mock/php-mock": "^2.0",
46-
"orchestra/testbench": "^3.8|^4.8|^5.7|^6.2|^7.0|^8.0|^9.0",
47-
"umbrellio/code-style-php": "^1.0",
46+
"orchestra/testbench": "^9.0",
47+
"umbrellio/code-style-php": "^1.2",
4848
"laravel/legacy-factories": "^1.0",
49-
"php-coveralls/php-coveralls": "^2.1",
50-
"squizlabs/php_codesniffer": "^3.5"
49+
"php-coveralls/php-coveralls": "^2.7"
5150
},
5251
"scripts": {
5352
"lint": "vendor/bin/ecs check src --config=ecs.php",

phpunit.xml.bak

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
bootstrap="vendor/autoload.php"
4+
colors="true" processIsolation="false"
5+
stopOnFailure="true"
6+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
7+
>
8+
<coverage>
9+
<include>
10+
<directory suffix=".php">./src</directory>
11+
</include>
12+
<exclude>
13+
<file>./src/Console/RollbackNewMigrations.php</file>
14+
</exclude>
15+
</coverage>
16+
<php>
17+
<env name="APP_ENV" value="testing"/>
18+
<ini name="error_reporting" value="-1"/>
19+
<var name="db_type" value="pdo_pgsql"/>
20+
<var name="db_host" value="127.0.0.1"/>
21+
<var name="db_username" value="postgres"/>
22+
<var name="db_password" value=""/>
23+
<var name="db_database" value="testing"/>
24+
<var name="db_port" value="5432"/>
25+
</php>
26+
<testsuites>
27+
<testsuite name="Test suite">
28+
<directory suffix="Test.php">./tests</directory>
29+
</testsuite>
30+
</testsuites>
31+
</phpunit>

tests.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ sed -e "s/\${USERNAME}/postgres/" \
99
-e "s/\${DATABASE}/testing/" \
1010
-e "s/\${HOST}/127.0.0.1/" \
1111
.env.sample > .env
12-
sed -e "s/\${LARAVEL_VERSION}/^8.0/" \
13-
-e "s/\${PHP_VERSION}/8.0.11/" \
12+
sed -e "s/\${LARAVEL_VERSION}/^11.0/" \
13+
-e "s/\${PHP_VERSION}/8.3.6/" \
1414
composer.json.sample > composer.json
1515
rm -rf release
1616
composer create-project laravel/laravel release
@@ -29,4 +29,5 @@ sed -e "s/\${USERNAME}/postgres/" \
2929
-e "s/\${DATABASE}/testing/" \
3030
-e "s/\${HOST}/127.0.0.1/" \
3131
phpunit.xml.dist > phpunit.xml
32-
php -d pcov.directory='.' vendor/bin/phpunit --coverage-html build --coverage-text
32+
php vendor/bin/phpunit -c phpunit.xml --migrate-configuration
33+
php -d xdebug.mode=coverage -d memory_limit=-1 vendor/bin/phpunit --coverage-html build --coverage-text

tests/functional/Console/RollbackMissingMigrationsTest.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use Generator;
88
use Illuminate\Support\Facades\Artisan;
99
use Illuminate\Support\Facades\DB;
10+
use PHPUnit\Framework\Attributes\DataProvider;
11+
use PHPUnit\Framework\Attributes\Test;
1012
use Umbrellio\Deploy\Exceptions\RollbackMissingMigrationException;
1113
use Umbrellio\Deploy\RollbackMissingMigrationServiceProvider;
1214
use Umbrellio\Deploy\Tests\FunctionalTestCase;
@@ -35,31 +37,25 @@ public static function provideMigrations(): Generator
3537
];
3638
}
3739

38-
/**
39-
* @test
40-
* @dataProvider provideMigrations
41-
*/
40+
#[Test]
41+
#[DataProvider('provideMigrations')]
4242
public function rollbackSuccessful(array $before, array $after): void
4343
{
4444
$this->assertSame($before, $this->getMigrations());
4545
$this->rollback(self::DATABASE_PATH . 'new_migrations', self::DATABASE_PATH . 'old_migrations');
4646
$this->assertSame($after, $this->getMigrations());
4747
}
4848

49-
/**
50-
* @test
51-
* @dataProvider provideMigrations
52-
*/
49+
#[Test]
50+
#[DataProvider('provideMigrations')]
5351
public function nothingToRollback(array $before, array $after): void
5452
{
5553
$this->assertSame($before, $this->getMigrations());
5654
$this->rollback(self::DATABASE_PATH . 'old_migrations', self::DATABASE_PATH . 'old_migrations');
5755
$this->assertSame($before, $this->getMigrations());
5856
}
5957

60-
/**
61-
* @test
62-
*/
58+
#[Test]
6359
public function rollbackFail(): void
6460
{
6561
$this->expectException(RollbackMissingMigrationException::class);

tests/unit/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)