mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 08:29:06 +00:00
20 lines
756 B
PHP
20 lines
756 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class ParseTest extends TestCase {
|
|
public function testParse(): void {
|
|
$files = glob("{*.php,**/*.php}", GLOB_BRACE);
|
|
foreach ($files as $file) {
|
|
$result = exec("php -l $file");
|
|
// Check for failure
|
|
self::assertStringNotContainsStringIgnoringCase("fail", $result);
|
|
self::assertStringNotContainsStringIgnoringCase("errors parsing", $result);
|
|
self::assertStringNotContainsStringIgnoringCase("error:", $result);
|
|
self::assertStringNotContainsStringIgnoringCase("warning:", $result);
|
|
// Check for success
|
|
self::assertStringContainsString("No syntax errors detected in ", $result);
|
|
}
|
|
}
|
|
}
|