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())
| 11 | // execute the function on a PHP thread directly |
| 12 | // this is necessary if tests make use of PHP's internal allocation |
| 13 | func 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 | |
| 28 | func TestGoString(t *testing.T) { |
| 29 | testOnDummyPHPThread(t, func() { |
no test coverage detected