(t *testing.T)
| 167 | } |
| 168 | |
| 169 | func TestFinishBootingAWorkerScript(t *testing.T) { |
| 170 | setupGlobals(t) |
| 171 | |
| 172 | _, err := initPHPThreads(1, 1, nil) |
| 173 | assert.NoError(t, err) |
| 174 | |
| 175 | // boot the worker |
| 176 | worker := getDummyWorker(t, "transition-worker-1.php") |
| 177 | convertToWorkerThread(phpThreads[0], worker) |
| 178 | phpThreads[0].state.WaitFor(state.Ready) |
| 179 | |
| 180 | assert.NotNil(t, phpThreads[0].handler.(*workerThread).dummyContext) |
| 181 | assert.Nil(t, phpThreads[0].handler.(*workerThread).workerContext) |
| 182 | assert.False( |
| 183 | t, |
| 184 | phpThreads[0].handler.(*workerThread).isBootingScript, |
| 185 | "isBootingScript should be false after the worker thread is ready", |
| 186 | ) |
| 187 | |
| 188 | drainPHPThreads() |
| 189 | assert.Nil(t, phpThreads) |
| 190 | } |
| 191 | |
| 192 | func TestReturnAnErrorIf2WorkersHaveTheSameFileName(t *testing.T) { |
| 193 | workers = []*worker{} |
nothing calls this directly
no test coverage detected