Skip to content

Commit a98d279

Browse files
pprkutondrejmirtes
authored andcommitted
Add integration test for autoload-psr (C-based autoloader)
1 parent a6a7bc2 commit a98d279

4 files changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/other-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,13 @@ jobs:
302302
cd e2e/bug7441
303303
composer install
304304
../../phpstan analyse -c app/phpstan.neon
305+
- php-version: 8.1
306+
extensions: autoload_psr-pprkut/autoload-psr@0.2.0
307+
ini-values: memory_limit=256M
308+
operating-system: ubuntu-latest
309+
script: |
310+
cd e2e/autoload-psr/app
311+
../../../phpstan analyse index.php -a autoload.php
305312
steps:
306313
- name: "Checkout"
307314
uses: actions/checkout@v3

e2e/autoload-psr/app/autoload.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
set_include_path(get_include_path() . ':' . __DIR__ . '/../libs/');
4+
5+
autoload_register_psr4_prefix('Foo\Bar', 'Foo/');

e2e/autoload-psr/app/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
include_once 'autoload.php';
4+
5+
$baz = new \Foo\Bar\Baz();

e2e/autoload-psr/libs/Foo/Baz.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
namespace Foo\Bar;
4+
5+
class Baz {}

0 commit comments

Comments
 (0)