addFiles([$source]); $compiler->prepareFile($source); $code = file_get_contents($compiler->convertFile($source)); self::assertIsString($code); $start = strpos($code, 'php::Array php_minmaxintegers('); self::assertNotFalse($start); $end = strpos($code, 'php::Array php_minmaxfallbacks(', $start); self::assertNotFalse($end); $integerBody = substr($code, $start, $end - $start); self::assertStringNotContainsString('php::call(', $integerBody); self::assertSame(13, substr_count($code, 'php::call(')); $castStart = strpos($code, 'php::Array php_minmaxcasts('); self::assertNotFalse($castStart); $castEnd = strpos($code, 'void php_main(', $castStart); self::assertNotFalse($castEnd); self::assertSame(2, substr_count(substr($code, $castStart, $castEnd - $castStart), 'php::toInt(a)')); } }