jdecool/scaleway-runtimepublic Fork
⑂ 1c57542
Commits
⬇ Clone ▾
git clone https://git.rickub.com/jdecool/scaleway-runtime.git
git clone ssh://git@rickub.com/jdecool/scaleway-runtime.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

test: configure PHPUnit, PHPStan and PHP-CS-FixerUnverified

Jérémy DECOOL committed 2026-11-13T21:45:12+01:00 Browse files
1c57542 parent: 546c014
added .php-cs-fixer.dist.php +17 -0
new file mode 100644
@@ -0,0 +1,17 @@
1+<?php
2+
3+declare(strict_types=1);
4+
5+$finder = (new PhpCsFixer\Finder())
6+ ->in([__DIR__.'/src', __DIR__.'/tests'])
7+ ->append([__FILE__]);
8+
9+return (new PhpCsFixer\Config())
10+ ->setRiskyAllowed(true)
11+ ->setRules([
12+ '@PER-CS' => true,
13+ '@Symfony' => true,
14+ '@Symfony:risky' => true,
15+ 'declare_strict_types' => true,
16+ ])
17+ ->setFinder($finder);
new file mode 100644
@@ -0,0 +1,17 @@
1+<?php
2+
3+declare(strict_types=1);
4+
5+$finder = (new PhpCsFixer\Finder())
6+ ->in([__DIR__.'/src', __DIR__.'/tests'])
7+ ->append([__FILE__]);
8+
9+return (new PhpCsFixer\Config())
10+ ->setRiskyAllowed(true)
11+ ->setRules([
12+ '@PER-CS' => true,
13+ '@Symfony' => true,
14+ '@Symfony:risky' => true,
15+ 'declare_strict_types' => true,
16+ ])
17+ ->setFinder($finder);
added phpstan.neon.dist +9 -0
new file mode 100644
@@ -0,0 +1,9 @@
1+includes:
2+ - vendor/phpstan/phpstan-phpunit/extension.neon
3+ - vendor/phpstan/phpstan-phpunit/rules.neon
4+
5+parameters:
6+ level: max
7+ paths:
8+ - src
9+ - tests
new file mode 100644
@@ -0,0 +1,9 @@
1+includes:
2+ - vendor/phpstan/phpstan-phpunit/extension.neon
3+ - vendor/phpstan/phpstan-phpunit/rules.neon
4+
5+parameters:
6+ level: max
7+ paths:
8+ - src
9+ - tests
added phpunit.xml.dist +22 -0
new file mode 100644
@@ -0,0 +1,22 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+ xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+ bootstrap="vendor/autoload.php"
5+ cacheDirectory=".phpunit.cache"
6+ colors="true"
7+ failOnDeprecation="true"
8+ failOnNotice="true"
9+ failOnWarning="true"
10+ failOnRisky="true"
11+ beStrictAboutOutputDuringTests="true">
12+ <testsuites>
13+ <testsuite name="default">
14+ <directory>tests</directory>
15+ </testsuite>
16+ </testsuites>
17+ <source>
18+ <include>
19+ <directory>src</directory>
20+ </include>
21+ </source>
22+</phpunit>
new file mode 100644
@@ -0,0 +1,22 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+ xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+ bootstrap="vendor/autoload.php"
5+ cacheDirectory=".phpunit.cache"
6+ colors="true"
7+ failOnDeprecation="true"
8+ failOnNotice="true"
9+ failOnWarning="true"
10+ failOnRisky="true"
11+ beStrictAboutOutputDuringTests="true">
12+ <testsuites>
13+ <testsuite name="default">
14+ <directory>tests</directory>
15+ </testsuite>
16+ </testsuites>
17+ <source>
18+ <include>
19+ <directory>src</directory>
20+ </include>
21+ </source>
22+</phpunit>
added tests/AutoloadTest.php +22 -0
new file mode 100644
@@ -0,0 +1,22 @@
1+<?php
2+
3+declare(strict_types=1);
4+
5+namespace JDecool\ScalewayRuntime\Tests;
6+
7+use Composer\Autoload\ClassLoader;
8+use PHPUnit\Framework\TestCase;
9+
10+// Placeholder until Phase 2 adds real classes: guards the PSR-4 mapping the runtime code will rely on.
11+final class AutoloadTest extends TestCase
12+{
13+ public function testPackageNamespaceMapsToSrc(): void
14+ {
15+ $paths = [];
16+ foreach (ClassLoader::getRegisteredLoaders() as $loader) {
17+ $paths = [...$paths, ...$loader->getPrefixesPsr4()['JDecool\\ScalewayRuntime\\'] ?? []];
18+ }
19+
20+ self::assertSame([realpath(__DIR__.'/../src')], array_map(realpath(...), $paths));
21+ }
22+}
new file mode 100644
@@ -0,0 +1,22 @@
1+<?php
2+
3+declare(strict_types=1);
4+
5+namespace JDecool\ScalewayRuntime\Tests;
6+
7+use Composer\Autoload\ClassLoader;
8+use PHPUnit\Framework\TestCase;
9+
10+// Placeholder until Phase 2 adds real classes: guards the PSR-4 mapping the runtime code will rely on.
11+final class AutoloadTest extends TestCase
12+{
13+ public function testPackageNamespaceMapsToSrc(): void
14+ {
15+ $paths = [];
16+ foreach (ClassLoader::getRegisteredLoaders() as $loader) {
17+ $paths = [...$paths, ...$loader->getPrefixesPsr4()['JDecool\\ScalewayRuntime\\'] ?? []];
18+ }
19+
20+ self::assertSame([realpath(__DIR__.'/../src')], array_map(realpath(...), $paths));
21+ }
22+}