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 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 | +} |