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

Function TestReturnAnErrorIf2WorkersHaveTheSameFileName

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

Source from the content-addressed store, hash-verified

190}
191
192func TestReturnAnErrorIf2WorkersHaveTheSameFileName(t *testing.T) {
193 workers = []*worker{}
194 workersByName = map[string]*worker{}
195 workersByPath = map[string]*worker{}
196 w, err1 := newWorker(workerOpt{fileName: testDataPath + "/index.php"})
197 assert.NoError(t, err1)
198 workers = append(workers, w)
199 workersByName[w.name] = w
200 workersByPath[w.fileName] = w
201 _, err2 := newWorker(workerOpt{fileName: testDataPath + "/index.php"})
202 assert.Error(t, err2, "two workers cannot have the same filename")
203}
204
205func TestReturnAnErrorIf2ModuleWorkersHaveTheSameName(t *testing.T) {
206 workers = []*worker{}

Callers

nothing calls this directly

Calls 2

newWorkerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected