addFiles([$testFile]); $compiler->prepareFile($testFile); $cppFile = $compiler->convertFile($testFile); $cpp = file_get_contents($cppFile); $this->assertSame(1, substr_count($cpp, 'php_get_callable_scope(')); $this->assertMatchesRegularExpression( '/php::CallableScope (tmp_var_\d+) = php_get_callable_scope\(/', $cpp, ); preg_match('/php::CallableScope (tmp_var_\d+) =/', $cpp, $matches); $this->assertGreaterThanOrEqual(4, substr_count($cpp, $matches[1])); } }