TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
579 B
23 lines
579 B
<?php
|
|
|
|
|
|
use PhpAot\Php\CompilerTest;
|
|
use PhpAot\Php\Exception\TestError;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ErrorTest extends TestCase
|
|
{
|
|
public function testDuplicateStaticVar()
|
|
{
|
|
try {
|
|
$o = CompilerTest::getInstance();
|
|
$file = __DIR__ . '/../code/duplicate.php';
|
|
$o->addFiles([$file]);
|
|
$o->convert($file);
|
|
} catch (TestError $exception) {
|
|
$this->assertStringContainsString('Duplicate static variable', $exception->getMessage());
|
|
return;
|
|
}
|
|
$this->fail();
|
|
}
|
|
}
|
|
|