| 1 |
<?php |
| 2 |
|
| 3 |
declare( strict_types = 1 ); |
| 4 |
|
| 5 |
namespace MediaWiki\Tests\Unit\composer\PhpUnitSplitter; |
| 6 |
|
| 7 |
use MediaWiki\Composer\PhpUnitSplitter\PhpUnitTestFileScanner; |
| 8 |
use PHPUnit\Framework\TestCase; |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
class PhpUnitTestFileScannerTest extends TestCase { |
| 15 |
|
| 16 |
public function testScanForTestFiles() { |
| 17 |
$scanner = new PhpUnitTestFileScanner( __DIR__ ); |
| 18 |
$files = $scanner->scanForFiles(); |
| 19 |
$expected = []; |
| 20 |
foreach ( glob( __DIR__ . DIRECTORY_SEPARATOR . "*Test.php" ) as $testFile ) { |
| 21 |
$expected[ basename( $testFile ) ] = [ $testFile ]; |
| 22 |
} |
| 23 |
$this->assertEquals( $expected, $files, "Expected PhpUnitSplitter test files to be found" ); |
| 24 |
} |
| 25 |
|
| 26 |
} |