Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc7be11

Browse files
ruddellclaude
andcommitted
Add PHP 7.4/8.x compatibility integration tests
Adds a minimal integration workflow that installs the library as a dependency (no dev deps) across PHP 7.4, 8.0, 8.2, and 8.4, then runs a smoke test verifying all key classes load and the service provider registers its bindings correctly. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent 9635df0 commit fc7be11

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

.github/smoke-test.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
require getcwd() . '/vendor/autoload.php';
4+
5+
echo 'PHP ' . PHP_VERSION . "\n\n";
6+
7+
$classes = [
8+
'Vimeo\Laravel\VimeoServiceProvider',
9+
'Vimeo\Laravel\VimeoManager',
10+
'Vimeo\Laravel\VimeoFactory',
11+
'Vimeo\Laravel\Facades\Vimeo',
12+
];
13+
14+
echo "Checking classes:\n";
15+
foreach ($classes as $class) {
16+
try {
17+
if (!class_exists($class)) {
18+
fwrite(STDERR, "FAIL: class not found: $class\n");
19+
exit(1);
20+
}
21+
} catch (\Throwable $e) {
22+
fwrite(STDERR, "FAIL: error loading $class: " . $e->getMessage() . "\n");
23+
exit(1);
24+
}
25+
echo " [OK] $class\n";
26+
}
27+
28+
echo "\nChecking service provider registration:\n";
29+
try {
30+
$app = new \Illuminate\Container\Container();
31+
$provider = new \Vimeo\Laravel\VimeoServiceProvider($app);
32+
$provider->register();
33+
} catch (\Throwable $e) {
34+
fwrite(STDERR, "FAIL: error registering service provider: " . $e->getMessage() . "\n");
35+
exit(1);
36+
}
37+
38+
foreach (['vimeo', 'vimeo.factory', 'vimeo.connection'] as $binding) {
39+
if (!$app->bound($binding)) {
40+
fwrite(STDERR, "FAIL: '$binding' not bound in container\n");
41+
exit(1);
42+
}
43+
echo " [OK] '$binding' registered\n";
44+
}
45+
46+
echo "\nAll smoke tests passed!\n";

.github/workflows/integration.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: PHP Compatibility
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
integration:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php: ['7.4', '8.0', '8.2', '8.4']
16+
17+
name: PHP ${{ matrix.php }} (integration)
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
path: package
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
29+
- name: Create test app
30+
run: |
31+
mkdir test-app
32+
echo '{"minimum-stability":"dev","prefer-stable":true,"require":{"vimeo/laravel":"*","illuminate/container":"*"},"repositories":[{"type":"path","url":"../package","options":{"symlink":false}}]}' > test-app/composer.json
33+
34+
- name: Install dependencies
35+
working-directory: test-app
36+
run: composer install --no-dev --no-interaction --prefer-dist
37+
38+
- name: Run smoke test
39+
working-directory: test-app
40+
run: php ../package/.github/smoke-test.php

0 commit comments

Comments
 (0)