setBuildMode(CompilerBase::BUILD_MODE_EXT); $compiler->setTargetName('call_cache_sites'); $source = TYPEPHP_ROOT_PATH . '/phpunit/code/call-cache-sites.php'; $compiler->addFiles([$source]); $compiler->prepareFile($source); $generated = $compiler->convertFile($source); $code = file_get_contents($generated); $extension = file_get_contents($compiler->genExtension()); self::assertIsString($code); self::assertIsString($extension); self::assertSame(1, substr_count($code, 'typephp_call_cached(')); self::assertSame(4, substr_count($code, 'php::callStaticMethod(')); self::assertStringNotContainsString('php::concat({', $code); self::assertSame(9, substr_count($code, 'php::VarList{')); self::assertStringNotContainsString('std::array 1]); $method = new ReflectionMethod($compiler, 'assertCallArgumentLimit'); (new ReflectionProperty($compiler, 'file'))->setValue($compiler, 'argument-limit.php'); $this->expectException(TestError::class); $this->expectExceptionMessage('A function call cannot contain more than 65536 arguments'); $method->invoke($compiler, array_fill(0, 65_537, $argument)); } }