MCPcopy Index your code
hub / github.com/php/frankenphp / TestReturnAnErrorIf2ModuleWorkersHaveTheSameName

Function TestReturnAnErrorIf2ModuleWorkersHaveTheSameName

phpmainthread_test.go:205–216  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

203}
204
205func TestReturnAnErrorIf2ModuleWorkersHaveTheSameName(t *testing.T) {
206 workers = []*worker{}
207 workersByName = map[string]*worker{}
208 workersByPath = map[string]*worker{}
209 w, err1 := newWorker(workerOpt{fileName: testDataPath + "/index.php", name: "workername"})
210 assert.NoError(t, err1)
211 workers = append(workers, w)
212 workersByName[w.name] = w
213 workersByPath[w.fileName] = w
214 _, err2 := newWorker(workerOpt{fileName: testDataPath + "/hello.php", name: "workername"})
215 assert.Error(t, err2, "two workers cannot have the same name")
216}
217
218func getDummyWorker(t *testing.T, fileName string) *worker {
219 t.Helper()

Callers

nothing calls this directly

Calls 2

newWorkerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected