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
671 B
23 lines
671 B
<?php
|
|
|
|
namespace TypePhp\Tests;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use TypePhp\CompilerTest;
|
|
|
|
class ForeachIndentTest extends TestCase
|
|
{
|
|
public function testObjectForeachRestoresCompilerIndentation(): void
|
|
{
|
|
global $translator;
|
|
$compiler = CompilerTest::create(ROOT_PATH);
|
|
$translator = $compiler;
|
|
$file = ROOT_PATH . '/phpunit/code/object-foreach-indent.php';
|
|
$compiler->addFiles([$file]);
|
|
$compiler->prepareFile($file);
|
|
$compiler->convertFile($file);
|
|
|
|
$reflection = new \ReflectionClass($compiler);
|
|
$this->assertSame(0, $reflection->getProperty('indentLevel')->getValue($compiler));
|
|
}
|
|
}
|
|
|