Skip to content

Commit bb10992

Browse files
committed
test(flow-php/flow-php-ext): all-optional structure phpt case follows the empty-payload cast fix
1 parent 7d1298d commit bb10992

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/extension/flow-php-ext/tests/phpt/026_row_hydrator_cast_parity.phpt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ $datasets = [
9696
new RawRowValues(['id' => null], ['id' => Metadata::fromArray(['k' => 'v2'])]),
9797
],
9898
],
99+
'all_optional_st' => [
100+
schema(structure_schema('st', type_structure([], ['b' => type_string()]))),
101+
[new RawRowValues(['st' => ['other' => 1]])],
102+
],
99103
'empty' => [schema(int_schema('id')), []],
100104
];
101105

@@ -135,6 +139,7 @@ uuid_json cast:yes
135139
containers cast:yes
136140
exotic_fallback cast:yes
137141
fill_and_metadata cast:yes
142+
all_optional_st cast:yes
138143
empty cast:yes
139144
schema_mutation cast:yes
140145
null_schema cast:yes

src/extension/flow-php-ext/tests/phpt/027_cast_fallback_exceptions.phpt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use Flow\ETL\Row\NativeRowHydrator;
1010
use Flow\ETL\Row\PhpRowHydrator;
1111
use Flow\ETL\Row\RawRowValues;
1212

13-
use function Flow\ETL\DSL\{schema, datetime_schema, date_schema, uuid_schema, json_schema, list_schema, map_schema, structure_schema};
14-
use function Flow\Types\DSL\{type_list, type_map, type_structure, type_integer, type_string, type_positive_integer};
13+
use function Flow\ETL\DSL\{schema, datetime_schema, date_schema, uuid_schema, json_schema, list_schema, map_schema};
14+
use function Flow\Types\DSL\{type_list, type_map, type_integer, type_string, type_positive_integer};
1515

1616
$throwing = [
1717
'uuid invalid' => [schema(uuid_schema('u')), [new RawRowValues(['u' => 'not-a-uuid'])]],
@@ -38,10 +38,6 @@ $throwing = [
3838
schema(list_schema('l', type_list(type_positive_integer()))),
3939
[new RawRowValues(['l' => [-3]])],
4040
],
41-
'all-optional structure' => [
42-
schema(structure_schema('st', type_structure([], ['b' => type_string()]))),
43-
[new RawRowValues(['st' => ['other' => 1]])],
44-
],
4541
];
4642

4743
$php = new PhpRowHydrator();
@@ -86,4 +82,3 @@ string map int keys exception:match aborted:yes
8682
list bad keys exception:match aborted:yes
8783
positive int list string exception:match aborted:yes
8884
positive int list negative exception:match aborted:yes
89-
all-optional structure exception:match aborted:yes

0 commit comments

Comments
 (0)