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

Function TestTypeMismatch

internal/extgen/integration_test.go:667–685  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

665}
666
667func TestTypeMismatch(t *testing.T) {
668 suite := setupTest(t)
669
670 sourceFile := filepath.Join("..", "..", "testdata", "integration", "type_mismatch.go")
671 sourceFile, err := filepath.Abs(sourceFile)
672 require.NoError(t, err)
673 defer suite.cleanupGeneratedFiles(sourceFile)
674
675 targetFile, err := suite.createGoModule(sourceFile)
676 require.NoError(t, err)
677
678 err = suite.runExtensionInit(targetFile)
679 assert.NoError(t, err, "generation should succeed - class is valid even though function/method have type mismatches")
680
681 baseDir := filepath.Dir(targetFile)
682 baseName := strings.TrimSuffix(filepath.Base(targetFile), ".go")
683 stubFile := filepath.Join(baseDir, baseName+".stub.php")
684 assert.FileExists(t, stubFile, "stub file should be generated for valid class")
685}
686
687func TestMissingGenStub(t *testing.T) {
688 // temp override of GEN_STUB_SCRIPT

Callers

nothing calls this directly

Calls 4

setupTestFunction · 0.85
cleanupGeneratedFilesMethod · 0.80
createGoModuleMethod · 0.80
runExtensionInitMethod · 0.80

Tested by

no test coverage detected