mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
[CI] Add parse test (covers !58)
This commit is contained in:
parent
166f114701
commit
08c19f253c
19
inc/test/php/ParseTest.php
Normal file
19
inc/test/php/ParseTest.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user