(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func TestPHPAssociativeArrayToPacked(t *testing.T) { |
| 105 | testOnDummyPHPThread(t, func() { |
| 106 | originalArray := AssociativeArray[string]{ |
| 107 | Map: map[string]string{ |
| 108 | "foo1": "bar1", |
| 109 | "foo2": "bar2", |
| 110 | }, |
| 111 | Order: []string{"foo1", "foo2"}, |
| 112 | } |
| 113 | expectedSlice := []string{"bar1", "bar2"} |
| 114 | |
| 115 | phpArray := PHPAssociativeArray(originalArray) |
| 116 | defer zendHashDestroy(phpArray) |
| 117 | convertedSlice, err := GoPackedArray[string](phpArray) |
| 118 | require.NoError(t, err) |
| 119 | |
| 120 | assert.Equal(t, expectedSlice, convertedSlice, "convert an associative array to a slice") |
| 121 | }) |
| 122 | } |
| 123 | |
| 124 | func TestNestedMixedArray(t *testing.T) { |
| 125 | testOnDummyPHPThread(t, func() { |
nothing calls this directly
no test coverage detected