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

Function TestInvalidSignature

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

Source from the content-addressed store, hash-verified

649}
650
651func TestInvalidSignature(t *testing.T) {
652 suite := setupTest(t)
653
654 sourceFile := filepath.Join("..", "..", "testdata", "integration", "invalid_signature.go")
655 sourceFile, err := filepath.Abs(sourceFile)
656 require.NoError(t, err)
657 defer suite.cleanupGeneratedFiles(sourceFile)
658
659 targetFile, err := suite.createGoModule(sourceFile)
660 require.NoError(t, err)
661
662 err = suite.runExtensionInit(targetFile)
663 assert.Error(t, err, "extension-init should fail for invalid return type")
664 assert.Contains(t, err.Error(), "no PHP functions, classes, or constants found", "invalid functions should be ignored, resulting in no valid exports")
665}
666
667func TestTypeMismatch(t *testing.T) {
668 suite := setupTest(t)

Callers

nothing calls this directly

Calls 5

setupTestFunction · 0.85
cleanupGeneratedFilesMethod · 0.80
createGoModuleMethod · 0.80
runExtensionInitMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected