(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestModuleWorkersWithDifferentFilenames(t *testing.T) { |
| 39 | // Create a test configuration with different worker filenames |
| 40 | configWithDifferentFilenames := ` |
| 41 | { |
| 42 | php { |
| 43 | worker ../testdata/worker-with-env.php |
| 44 | worker ../testdata/worker-with-counter.php |
| 45 | } |
| 46 | }` |
| 47 | |
| 48 | // Parse the configuration |
| 49 | d := caddyfile.NewTestDispenser(configWithDifferentFilenames) |
| 50 | module := &FrankenPHPModule{} |
| 51 | |
| 52 | // Unmarshal the configuration |
| 53 | err := module.UnmarshalCaddyfile(d) |
| 54 | |
| 55 | // Verify that no error was returned |
| 56 | require.NoError(t, err, "Expected no error when two workers in the same module have different filenames") |
| 57 | |
| 58 | // Verify that both workers were added to the module |
| 59 | require.Len(t, module.Workers, 2, "Expected two workers to be added to the module") |
| 60 | require.Equal(t, "../testdata/worker-with-env.php", module.Workers[0].FileName, "First worker should have the correct filename") |
| 61 | require.Equal(t, "../testdata/worker-with-counter.php", module.Workers[1].FileName, "Second worker should have the correct filename") |
| 62 | } |
| 63 | |
| 64 | func TestModuleWorkersDifferentNamesSucceed(t *testing.T) { |
| 65 | // Create a test configuration with a worker name |
nothing calls this directly
no test coverage detected