Page MenuHomeDevCentral

PSR4AutoloaderTest.php
No OneTemporary

PSR4AutoloaderTest.php

<?php
declare(strict_types=1);
namespace Keruald\OmniTools\Tests\Registration;
use Keruald\OmniTools\Registration\PSR4\Solver;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
class PSR4AutoloaderTest extends TestCase {
///
/// Tests
///
#[DataProvider('providePaths')]
public function testGetPathFor (string $class, string $expected) : void {
$this->assertEquals($expected, Solver::getPathFor($class));
}
///
/// Data provider
///
public static function providePaths () : iterable {
// Example from PSR-4 canonical document
yield ['File_Writer', 'File_Writer.php'];
yield ['Response\Status', 'Response/Status.php'];
yield ['Request', 'Request.php'];
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Nov 16, 13:16 (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3136250
Default Alt Text
PSR4AutoloaderTest.php (777 B)

Event Timeline