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

Function testOnDummyPHPThread

types_test.go:13–26  ·  view source on GitHub ↗

execute the function on a PHP thread directly this is necessary if tests make use of PHP's internal allocation

(t *testing.T, test func())

Source from the content-addressed store, hash-verified

11// execute the function on a PHP thread directly
12// this is necessary if tests make use of PHP's internal allocation
13func testOnDummyPHPThread(t *testing.T, test func()) {
14 t.Helper()
15
16 globalLogger = slog.Default()
17 _, err := initPHPThreads(1, 1, nil) // boot 1 thread
18 assert.NoError(t, err)
19 handler := convertToTaskThread(phpThreads[0])
20
21 task := newTask(test)
22 handler.execute(task)
23 task.waitForCompletion()
24
25 drainPHPThreads()
26}
27
28func TestGoString(t *testing.T) {
29 testOnDummyPHPThread(t, func() {

Callers 7

TestGoStringFunction · 0.85
TestPHPMapFunction · 0.85
TestPHPPackedArrayFunction · 0.85
TestNestedMixedArrayFunction · 0.85

Calls 6

initPHPThreadsFunction · 0.85
convertToTaskThreadFunction · 0.85
newTaskFunction · 0.85
drainPHPThreadsFunction · 0.85
executeMethod · 0.80
waitForCompletionMethod · 0.80

Tested by

no test coverage detected