MCPcopy Create free account
hub / github.com/php/frankenphp / runExtensionInit

Method runExtensionInit

internal/extgen/integration_test.go:102–119  ·  view source on GitHub ↗
(sourceFile string)

Source from the content-addressed store, hash-verified

100}
101
102func (s *IntegrationTestSuite) runExtensionInit(sourceFile string) error {
103 s.t.Helper()
104
105 os.Setenv("GEN_STUB_SCRIPT", s.genStubScript)
106
107 baseName := SanitizePackageName(strings.TrimSuffix(filepath.Base(sourceFile), ".go"))
108 generator := Generator{
109 BaseName: baseName,
110 SourceFile: sourceFile,
111 BuildDir: filepath.Dir(sourceFile),
112 }
113
114 if err := generator.Generate(); err != nil {
115 return fmt.Errorf("generation failed: %w", err)
116 }
117
118 return nil
119}
120
121// cleanupGeneratedFiles removes generated files from the original source directory
122func (s *IntegrationTestSuite) cleanupGeneratedFiles(originalSourceFile string) {

Callers 7

TestBasicFunctionFunction · 0.80
TestConstantsFunction · 0.80
TestNamespaceFunction · 0.80
TestInvalidSignatureFunction · 0.80
TestTypeMismatchFunction · 0.80
TestCallableFunction · 0.80

Calls 2

GenerateMethod · 0.95
SanitizePackageNameFunction · 0.85

Tested by

no test coverage detected