Skip to content

Commit

Permalink
test: Make the min PHP version test compatibility more complete (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Nov 4, 2023
1 parent e5a152c commit 9fa37d8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
6 changes: 6 additions & 0 deletions fixtures/set039-min-php-version/composer.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
{
"autoload": {
"files": ["src/greet.php"],
"psr-4": {
"App\\": "src"
}
}
}
6 changes: 1 addition & 5 deletions fixtures/set039-min-php-version/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?php

namespace App;

require file_exists(__DIR__.'/vendor/scoper-autoload.php')
? __DIR__.'/vendor/scoper-autoload.php'
: __DIR__.'/vendor/autoload.php';

class Greeter {}

echo "OK\n";
greet();
2 changes: 2 additions & 0 deletions fixtures/set039-min-php-version/scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
);

return [
'exclude-files' => ['index.php'],
'expose-classes' => ['App\Greeter'],
'expose-functions' => ['greet'],
];
11 changes: 11 additions & 0 deletions fixtures/set039-min-php-version/src/Greeter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App;

class Greeter
{
function greet()
{
echo "OK\n";
}
}
7 changes: 7 additions & 0 deletions fixtures/set039-min-php-version/src/greet.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use App\Greeter;

function greet() {
(new Greeter())->greet();
}

0 comments on commit 9fa37d8

Please sign in to comment.