Alright, I added some tests that look like this:
func (PHPSuite) TestEnumKind(ctx context.Context, t *testctx.T) {
c := connect(ctx, t)
module := phpModule(t, c, "enum-kind")
t.Run("built-in (string-backed)", func(ctx context.Context, t *testctx.T) {
out, err := module.
With(daggerCall("opposite-network-protocol", "--arg=TCP")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "UDP", out)
})
t.Run("custom (int-backed)", func(ctx context.Context, t *testctx.T) {
out, err := module.
With(daggerCall("increase-priority", "--priority=1")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "2", out)
})
t.Run("custom (string-backed)", func(ctx context.Context, t *testctx.T) {
out, err := module.
With(daggerCall("toggle-todo", "--task=todo")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "done", out)
})
}
The module they're calling is located at core/integration/testdata/modules/php/enum-kind/src/EnumKind.php
I believe there's a way to call the entire test suite from Dagger, but honestly... I always forget what it is.
What I end up doing is going into the module's dagger.json and changing the sdk's source to "source": "../../../../../../sdk/php" and just calling it from inside the module.
Right now, it's breaking: I'm getting this sorta thing Error: convert return value: unexpected result value type map[string]interface {} for enum "EnumKindTask" [traceparent:3b1b3acdbf083f34842525649bf2fd4a-47162dbf703935d4]